Enter your password incorrectly 3 times.
- If you see the option to restart and show password reset options, click it to restart your Mac. Then take one of these steps:
- Sign in with your Apple ID, if asked. You might also be asked to enter the verification code sent to your other devices.
- Enter your FileVault recovery key, if asked. It's the long string of letters and numbers you received when you turned on FileVault and chose to create a recovery key instead of allowing your iCloud account (Apple ID) to unlock your disk.
- Select a user that you want to reset the password for, then click Next.
- Enter your new password information, then click Next.
- When the password reset is completed, click Restart.
- If you see the option to reset using your Apple ID, click it.
- If your Mac restarts, follow the steps for option 1, above.
- If your Mac doesn't restart, but immediately asks for your Apple ID, enter that information and click Reset Password.
- If you're asked to create a new keychain to store the user's passwords, click OK to restart your Mac.
- If you're asked to select an admin user you know the password for, click “Forgot all passwords?”.
- If you see a Reset Password window with the option to Deactivate Mac, click Deactivate Mac, then click Deactivate to confirm. This is temporary.
- Enter your new password information, then click Next.
- If this window shows multiple user accounts, click the Set Password button next to each account name, then enter the new password information for each account.
- When the password reset is completed, click Restart.
- Click the option to reset using your recovery key.
- Enter your FileVault recovery key. It's the long string of letters and numbers you received when you turned on FileVault and chose to create a recovery key instead of allowing your iCloud account (Apple ID) to unlock your disk.
- Enter your new password information, then click Reset Password
If you aren't able to use any of these reset options, you may need to reset your MacBook.
*Determine whether you're using a Mac with Apple silicon, then follow the appropriate steps to start up from macOS Recovery:
- Apple silicon: Turn on your Mac and continue to press and hold the power button until you see the startup options window. Select the gear icon labeled Options, then click Continue.
- Intel processor: Turn on your Mac and immediately press and hold Command (⌘)-R until you see an Apple logo or other image.
Keep this in mind for the following steps.*
If no other solution is successful, you have the option to reset your password by erasing your Mac.
- Shut down your Mac, then start up from macOS recovery as described previously.
- When you're asked to select an admin user you know the password for, choose Erase Mac from the Recovery Assistant menu in the menu bar.
- From the Erase Mac window, click Erase Mac, then click Erase Mac to confirm.
- If your Mac restarts to a flashing question mark, press and hold the power button for a few seconds until your Mac turns off.
- Start up from macOS Recovery again, then reinstall macOS. For details, see How to reinstall macOS.
Sources:
https://support.apple.com/en-us/HT212190
https://support.apple.com/en-us/HT202860
Hope this helps!