Apple’s Keychain feature allows your Mac to remember all of your passwords and recall them back to you. Keychain Access is the built-in software that accompanies Keychain and is where most of your private details are stored. This is often most handy with Wi-Fi connections. If you find yourself in an unfamiliar place or even if you’ve forgotten your own Wi-Fi password, you can use Keychain Access on your Mac to find that password.
You’d be surprised, but the area this comes in handy with the most is Wi-Fi connections. It’s simple: open Keychain Access by searching for it in Spotlight (Cmd + Space), search for the name of the WiFi Hotspot and double-click the iCloud Keychain corresponding to the SSID you seek. Click ‘Show Password’ and enter the Keychain password set earlier. This will show you the Wi-Fi password.