UniFi devices that appear offline can often be remedied by a set of simple physical checks.
Check Device Hardware
Check your product’s datasheet to verify whether it requires PoE, PoE+, or PoE++ power. Ensure that the switch or PoE adapter used to power it is capable of this output. Compatible PoE adapters can be purchased here.
Note: Insufficient power may only occur intermittently such as when many clients connect to a given AP, or when security cameras turn on their infrared (IR) lights at night.
High-quality UniFi cables can be purchased here. If you are powering devices over a longer cable length with PoE, then try using a short cable (3ft / 1m) instead and check if the behavior is the same.
Plug your device into a switch port that is known to be working in order to rule out damage on the previous one.