Response:
Hello there! In this situation, you can try the following steps:
Step 1: When you start up your Mac, you'll see the option to select Restart at the bottom of the screen.
Step 2: Next, quickly press the
Step 3: At this point, you'll enter the recovery screen. Choose Utilities ->Terminal to launch the Terminal command-line application of Mac OS X.
Step 4: Type in the command 'resetpassword' in the Terminal program window and press Enter.
Step 5: Close this window, and you'll see the Reset Password Utility application window appear.
At this point, you'll select the account you need to reset the login password for, enter the new password (or leave it blank if you don't want to set a password), confirm the new password, and finally, click the Save button to complete the process.
Step 6: Then, restart your Mac, and you can use the new password to log in as usual.
(Image source: Internet)
For more details, you can refer to how to log in to Macbook when you forget your password as previously introduced by Mytour.
Additionally, for Windows users, if you forget your login password to the system, you can easily regain access to your computer by following the steps outlined in the article on logging into Windows when you forget your password, which are incredibly straightforward.
Wishing you success!