I'm trusting you to use these tips only on your own devices to recover your own WiFi network password. I guess it's okay to help your neighbors and family members out too.
Let's first think about how not to lose the WiFi password. I use a password manager and store my very long and incomprehensible password in a secure note. If I ever need it, it is simple to copy and paste the password from the manager into the connection text box when asked for the WiFi password.
If you don't use a password manager, consider it. I know some of you may use sticky notes or other paper based methods, but there's always the chance of losing those notes. Some of you may use Excel files, which is OK unless your device gets stolen. Even if you've password protected the Excel file, it's fairly easy to crack the password with third-party apps.
Let's look at some ways to recover that password.
Check the label on your router. It's default wireless network name (SSID) and password are usually on the router label. If you didn't change the default WiFi password, then you've found it!
Hopefully you've changed the router's default login password (usually it's password, it is not the same as the WiFi password), to something else so that hackers can't gain easy access to to the device. If you can log in to the router, you can usually find your WiFi password on the WiFi Setup screen. But wait, you don't have a WiFi connection, so how do you log in to the router? Connect an Ethernet cable between your computer and one of the router's device connectors, not the WAN or Internet connector. Type the router login website name into the browser's address bar. The login site is also usually listed on the router label.
Use the Windows Command Prompt to find the password. This works only if the Windows device has previously connected to your WiFi network.
Click the Start Button and type cmd.
When Command Prompt appears at the top of the menu, click Run as Administrator on the right.
You'll probably see a prompt that looks like this: "C:\WINDOWS\system32>" without the quotes.
Type netsh wlan show profile and press Enter.
You will see a list of WiFi networks. note the name of your home's network.
Type netsh wlan show profile name="XXXXXXXX" key=clear and substitue the name of your WiFi network for the Xs.
Look for the Key Content in the Settings section. that's your WiFi password.
My thanks to this PC Magazine article for reminding me of this hack. I had forgotten it.