Are you able to get other devices to access the WiFi you are having trouble accessing? If they work fine, and it is only your phone that doesn't, try the following...
1. Try and restart the phone. Sometimes it is that simple.
2. Update the firmware and any apps that need updating on the phone.
3. If the problem persists, check your time and date on the phone to make sure it is correct.
4. Should none of the former work...
a. Clear out the WiFi data on the phone.
b. Reboot the modem/router.
c. Once the modem/router is fully 'up' again, reboot the phone and re-input the WiFi data.
5. Now, if you are still having the problem at this point, and you are sure it isn't the modem/router that is the problem. Then you may wish...