However, if you DO need to try to recover info before you rush headlong into resetting a lost password, I’d check your browser first for any items you might have typed into that program (like a website login). In Safari, that information is stored in Safari > Preferences > Passwords. Within there, you’ll see a list of what it has saved, and you can select something, click the “Show passwords for selected websites” box, and then type in your Mac’s password to reveal what’s there.
Firefox and Chrome both have similar ways to access their saved passwords, but of course, this’ll only be useful if you’ve actually asked your browser to store that data.
Another option is to use the built-in Keychain Access program, which is in your Applications > Utilities folder. If you open that and make sure “All Items” is selected from the sidebar…
…you can look through the list (or use the search box at the top-right of the window) to find what’s been lost. For example, if I wanted to get the password for a Wi-Fi network I’d joined, I can type a relevant term into the search box:
And everything matching that search will appear.
So to get your passwords out of this long list, just double-click any stored keychain item, and you’ll see something like this:
Click the “Show password” box, type in your Mac’s password to prove to your computer that you’ve got the right to do what you’re asking, and Keychain Access will show you the associated password.
In my experience, this often requires a little bit of sleuthing—if there are several entries for the Wi-Fi password you’re trying to find, say, you may have to check a few of them or pay attention to the “Date Modified” column to sort out which one is most relevant. But every time your Mac asks you if you’d like to store a password, this is where it keeps things, so you should be good to go afterward!
…But have I mentioned that you should get a password manager? You really should. My hot-button topic will always be backups, but password security is a close second.