There has been very little research done on snakes and sleep so the exact mechanisms are unknown but snakes do sleep despite not having any eyelids
They physically are not able to close their eyes. Humans have eyelids not only to aid with sleep but also to protect our eyes. Although snakes don’t have eyelids, their eyes are still protected.
They have a transparent layer covering the surface of the eye called ‘spectacles’, which stop the eye becoming dry.
These shed just like the rest of the snake’s skin, which can be very bizarre to see. There’s no real way to tell is a snake is asleep or not. You could guess by its lack of movement but snakes often just sit very still anyway.