NOTE: If none of the following work to resolve the problem, and if the phone is under warranty, I would contact the manufacturer.
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. Check your internet connection. It may be what is going in and out rather than the phone.
6. Make sure you have "Data" turned off on the device when using "WiFi" (that is if you have a plan with data through your phone). If youdn't make sure it is turned off, the device can keep trying to switch to "Data" when you try and use "WiFi".
7. 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 to try a "Hard Reset" of the device. However, I really suggest saving this as a last option (or last before parts repair/replacement).
Since you said you already reset it (assuming you did a full "Hard Reset" and not a "Factory Reset" with option to save your personal stuff, then it may well need hardware repaired.
If, however, you did do the reset that let you keep your personal stuff on the phone, that would not have fixed the problem. In that case I would try the "Hard Reset".