1. Use Your Apple ID
Restart your Mac and wait until you see the login screen.
Click on "Forgot password?" next to the password field.
Follow the instructions to reset your password using your Apple ID.
2. Use Recovery Mode
Turn off your MacBook.
Press and hold the Power button until you see the startup options, then click on Options and Continue.
Select your user account and then click on "Forgot all passwords?".
Follow the prompts to reset your password.
3. Reset with Another Admin Account
If you have another admin account on your MacBook, you can log into that account and change the password for your account:
Go to System Settings > Users & Groups.
Select your account and click Reset Password.
4. Use FileVault Recovery Key
If you have FileVault enabled, you might have a recovery key.
You can use this recovery key to reset your password.
5. Contact Apple Support
If you can't reset your password using the above methods, you might need to contact Apple Support for assistance.
6. Reset Password Using Terminal in Recovery Mode
If you can't reset the password using the methods mentioned earlier, you can try resetting it through Terminal in Recovery Mode.
Turn off your MacBook.
Press and hold the Power button until you see the startup options.
Select Options and then click Continue.
From the menu, choose Utilities and then select Terminal.
In the Terminal window, type the following command and press Enter:
resetpassword
A Reset Password window will open, allowing you to select your user account and reset the password.