A fish exhibits several signs that tell you that the fish is sleeping. A few of them are:
The fish is not moving for more than a couple of minutes.
They could be floating in a place, lying immobile at the top or bottom of a tank, or beneath a coral.
Their response to stimuli like food or light is much slower than usual.
You find them resting around the same time every day.