TL;DR: If you can’t connect to wifi make sure you don’t have too many USB devices drawing power.
This was a really strange one. My Mac Mini couldn’t connect to wifi and there seemed to be no reason why. It looks like I was trying to pull too much data through the USB ports with external hard drives. Once I unplugged my USB hub, the wifi connected again fine.