Welcome to iMore! Make sure you have a good wifi signal. Try rebooting your wifi modem/router. It's possible the modem or router may be bad. Check with your wifi provider, they may be having problems. Try toggling wifi off in settlngs, then back on.
Welcome to iMore. I'm not sure if this is the type of answer you're looking for, but I have issues with connecting to Wi-Fi in my office. The signal is fair at best, and sometimes, flat out poor! When I have connection issues, I try the go to settings, toggle wi-fi off, wait a few seconds, and then toggle wi-fi back on. That seems to work much of the time. I will also do a hard reset from time to time.