Forgetting your password on your Mac is a very common situation, and here are a few things you can try to fix this:
Method 1: Use Apple ID to reset password.
On the login screen, tap"Password"box below"?"button, or simply enter the wrong password three times.
A dialog box will appear, click on it"apple id"field"Reset your password"Link.
Open the Apple ID account page in your browser and follow the instructions to complete the process of resetting your password.
After resetting your password, log in to your Mac computer with the new password.
Method 2: Use Recovery Mode to reset password.
Power off, then press and hold the Command and R keys at the same time to power on and enter recovery mode.
On the interface of the recovery mode, select"Utilities"down"Password reset"。
Select your system disk and select the user account for which you have forgotten your password.
Enter your new password and confirm it.
Click"Change your password"to complete the password reset.
Restart your computer and log in with your new password.
Method 3: Use another administrator account to reset your password.
If you have another administrator account set up on your computer, you can use that account to reset your password.
On the login page, select the administrator account to log in.
Enter"System Preferences"Click"Users & Groups"。
Select the user account for which you want to reset your password and select it on the right"Change your password"。
Enter a new password and confirm your password, then click"Change your password"to complete the reset.
Sign out of your administrator account, log back in to your account, and log in with your new password.
If none of the above methods can solve the problem, it is recommended to contact Apple's official customer service or visit an Apple authorized repair center, and they will give more detailed guidance and help according to your specific situation. In addition, in order to avoid similar situations from happening again, it is recommended that you regularly back up your important data and keep your passwords in a safe place.