This method will only work if you’ve previously or are currently connected to the wireless network you’re trying to recover the password for. Mac stores all it’s passwords in a utility called “keychain access” and to recover any password be it wireless, application or a web-form password, this is the app you need to be using. Keychain Access is located in /Applications/Utilities/ so if you open Finder and go to Applications -> Utilities you should be able to see the app.
Once you see it, open the app and you will see the field “Kind” under which you will see the type of the password. Example: application passwords will have “application passwords” as their kind, network passwords will be “Airport network password” which is where the wi-fi password will be.
For OS X Yosemite, you need to pick “local items” instead of login items. You can also search for the app, name or network name in the search bar, which will immediately list down the specific stored passwords.
Double click the name of your network, if you do not what it is then click the concentric quarter circles towards the right side of your menu bar and that will show which network is it. So once you have the name, search for it. Then doubleclick it, and put check on “Show Password“, this will ask you for your system password, enter it and hit the Allow button. This will reveal the password stored.