Padmé Amidala is seen here, resting in her bed on Coruscant
The act of sleeping was a natural function for beings, whether sentient or not, where they would rest and allow their bodies to recover. Typically, human-like sentients would do this regularly, often using a comfortable item, like a bed. It was common for beings to experience dreams while asleep, which were essentially bizarre versions of their waking lives. Insufficient sleep could negatively impact a being's mental state.
A particular kind of sleep, REM sleep, was essential for the mental well-being of individuals like the Kiffar Quinlan Vos; its absence was damaging. The Confederacy of Independent Systems actively prevented this phase in their prisoner by using machines to detect it and then immediately shocking the subject, waking them up and causing mental exhaustion. This lack of sleep played a role in Vos's descent to the dark side of the Force.
Garazeb Orrelios is seen here having knocked out a stormtrooper
Anakin Skywalker struggled with sleep after he began to experience Force visions of his mother, Shmi Skywalker Lars, passing away. Later on, he had similar issues after a Force vision during sleep showed his wife, Padmé Amidala, dying during childbirth. Darth Sidious murdered Darth Plagueis, his master, while Plagueis was asleep.
While droids, being mechanical, cannot sleep, some could at least "power down," entering a state similar to sleep where they were inactive but could instantly reactivate.
Certain Force users had the ability to use their powers to calm others, as demonstrated by Qui-Gon Jinn on Jar Jar Binks. They could even induce sleep and unconsciousness, as shown by Kylo Ren on Rey and Mace Windu on Rako Hardeen. Additionally, a White Loth-wolf possessed the power to make beings like Sabine Wren fall asleep.
Chadra-Fans only required around three hours of sleep per day, substantially less than what humans typically needed.