In the Control Panel search box, type create password reset. In the search box on the taskbar, type Control Panel, and then choose it from the list of results.
Plug a USB flash drive into your PC. Although creating a password reset disk won't reformat your USB flash drive, you should back up any data on it before you continue. This won't work with Microsoft (connected) accounts. Make sure you're signed in with your local account. To do this, select Start > Settings > Accounts > Sign-in options > Update your security questions. If you wait until you've forgotten your password, it'll be too late. We recommend you add security questions to your local account in case you forget your password, so you don't need to create a password reset disk.
Then, if you forget your password, you can reset it.
If you use a local account in Window 11, you should create a password reset disk using a USB flash drive as soon as possible.