My 90 year old grandfather recently forgot the administrator password to his Mac. He'd set it up a couple years ago and just couldn't recall it. He also couldn't remember his AppleID (let alone the password) either.
Fortunately there's a little-known way to reset an account's password using what Apple calls "Recovery Mode".
1 - Reboot the computer while holding down the "cmd" and "r" keys
This will take you into Recovery Mode where you have access to a limited set of system tools.
2 - Open the "terminal" application by selecting "Utilities -> Terminal"
3 - Type "resetpassword" and press enter
You should now see a new dialog where you are able to select an account to modify. Choose the one you want to change, provide a new password, confirmation, and hint.
Fortunately these steps allowed me to get Grandpa's computer up and running! For obvious reasons this technique doesn't seem to be promoted by Apple as Grandpa had been on tech support with them and they never suggested it.
Either way, I'm thankful it worked!