This is impossible, by design. The reason is that if someone manages to read some of your files, for example because they have temporary access to your computer, or because they got hold of a backup, they must not be able to find your password.
When your computer verifies your password, it doesn't just compare the password with a stored reference copy of the password. It first calculates a password hash, then compares the result with the stored reference hash. By design, a password hashing function only works one way: it's impossible to calculate the password from the hash. If you only know the hash, the best you can do is to guess the password and check your guess.
If you've forgotten your login password, and you haven't written it down anywhere, the only solution is to change it. (Despite what it often said, writing a password down can be a good idea — but it must be on paper, and the paper must be stored somewhere secure such as a bank safe, not a post-it note in view of your webcam.)
If you've partly forgotten your password (e.g. you remember that it's
Iloveyou and a number but you don't remember the number — obviously this example is a bad password!), there are tools that can help you crack it. You need to obtain the password hash then assist the tool with everything you know about the password. That's only realistic if you almost remember the password.
If you've used the same password for something else, of course, it may be stored somewhere else. If you've used it for a service that you accessed from the Mac, it's probably in your keychain. Of course, if you can't get into the keychain because you've forgotten the password, that's again by design, sorry.