I have seen reports of some phones having WiFi issues after recent system updates. This seems to be most common in the Moto G4, but I am also seeing it in the Moto Z Play. So if you have had a recent system update and were able to connect to a WiFi network previously without issue, but now you can’t after the update I recommend checking to see what security standard you are using for your network. If you are able to connect to other networks, but not the one in your home, this is a huge clue. I am not sure if this is linked to a certain date Security Patch from Google, but is 100% related to the router using WEP for the wireless security protocol. WEP standards for Wireless Security Privay. It is a rather outdated security standard and in my opinion isn’t much better than just leaving your network open (without a password). For those that are interested in reading more about WEP : https://www.lifewire.com/definition-of-wired-equivalent-privacy-816575
If the symptoms I described sound like something you are going through, I would recommend you see if your router is using WEP security and change it to WPA or WPA2. With there being so many routers variations out there, it is difficult to cover them all, but here are some links for major brands that should help.
For other routers, a Google search (or your favority search engine) of “Change wireless security settings of…” and the make and model of your router should help you get instructions on how to change the security settings. I would recommend you use the latest standard for WiFi security protocol which is WPA2 if that is an option for your router. If you have some older hardware that hooks up to your network, WPA2/WPA Mixed Mode would also work.