TRY THE FOLLOWING STEPS:-
Restart your phone, check the WiFi connection icon on the phone screen, and move closer to a WiFi access point to get a better signal.
2.Make sure that your phone is not in Battery saver mode (Settings > battery saver), or connect a charger.
3.Disable Bluetooth connectivity in your phone while being connected to WiFi (Settings > Bluetooth). Bluetooth and WiFi operate on the same frequency range and may interfere with each other.
4.If you cannot connect to a network that you have connected to before, try deleting the network from your phone. (To do this, in Settings > WiFi > manage (advanced), under Known networks, tap and hold the network name, then tap Delete.) Deleting the network will delete the associated settings on your phone. After that, tap the WiFi network in the list of networks, then try to connect again.
5.If there is no SIM card in your phone, try inserting SIM and check that you are not in flight mode. If there is no SIM card in the phone, some of the country specific WiFi features may not be available when your phone does not know its location.
6.Check if you can connect with your phone to another WiFi network (for example using the internet sharing feature of another phone).
7.Use your mobile data, check if there is new software available for your phone: Tap Settings > phone update.
8.If still the problem persists do hard reset and before doing back up all your important files etc.