If are you near an Apple Store make a genius bar appointment and take your Mac in for technical assistance.
Make sure your wifi security is configured correctly.
If are using a lot of third party software, check to see if any of it has added kernel extensions, especially anything using the network in a non-standard way, like a game server, for example. Sometimes a third-party kernel extension totally messes up your ability to connect by wifi. A lot of programmers just port things games from Windows without regard for the OS X API, then try to work around the problems they create by adding kernel extensions. Not good, but true.
After all of this checks out and gets fixed:
Go to System Preferences in the Apple menu.
Click on Network. (It may say Network Settings on some system systems.)
Click the Turn Wifi Off button near the top of the Network panel.
Unlock the lock in the lower left corner if necessary. This requires admin ID and password.
Click Advanced button
Select your wifi network and
Click the minus âž– sign to delete it
Click OK
Click Apply
Open the Keychain Access application in Applications > Utilities folder.
Find your network name in the list.
Delete the login password for your network.
Then go back to Network settings and turn wifi on.
Click Advanced button.
Click plus âž• sign.
Click Choose a Network.
Select your network and enter your password
Click Okay
Click Apply
This should work. Sometimes the settings get hosed, but not very often. I have had this happen once in 10 years with Mac OS X.