Are you able to connect to WiFi network at the first place? If no, that could be the problem.
If you are able to connect to a WiFi network and it is indeed connected, you can try connecting to another WiFi network to further isolate the issue.
You can also try the below steps. You can try configuring on your phone the WiFi you are trying to connect to.
Hope this helps, Mia002.