This is Apple’s guidance for resetting your Mac’s login password:
If you forgot your Mac login password - Apple Support
Apple Silicon Mac:
1 - Choose Apple menu > > Shut Down.
2 - Press and hold the power button on your Mac until you see “Loading startup options.”
3 - Click Options, then click Continue.
4 - Top Tool Bar > Utilities > Terminal
5 - Type resetpassword (one word, no spaces)
6 - Press Return key
7 - Follow the prompts and remember the New Password
Intel Mac:
1 - Restart computer and immediately hold Command + R keys
2 - Top Tool Bar > Utilities > Terminal
3 - Type resetpassword (one word, no spaces)
4 - Press Return key
5 - Follow the prompts and remember the New Password