Try rebooting the Mac. If you still cannot activate WiFi, then check the Apple System Profiler to see whether the WiFi hardware is even seen. To access the System Profiler, hold down the Option key while clicking the Apple menu, then select the top option. On the left pane there will be a "Network" section with a "WiFi" subsection. If you don't see any reference to the WiFi physical hardware, then you most likely have a hardware issue of some sort.
If you see the WiFi hardware, then try booting into Safe Mode to see if it makes any difference to activate the WiFi.
You can also try running the Apple Diagnostics. Since the diagnostics are online, you will need to connect to the WiFi ..... if you are not able to see any local wireless networks to select, then again you likely have a hardware issue of some sort.
Here is an Apple article for troubleshooting network issues:
If your Mac isn't connecting to the internet over Wi-Fi - Apple Support