You can sleep by interacting with a bed (by default, interact is the space bar).
Sleep takes 100 turns if undisturbed.
You can rest without a bed by pressing your modifier key+Skip Turn key (Ctrl+X by default). Resting also takes 100 turn.
Resting will regenerate health and psi points.
Interacting with a bed is less play-time consuming for the player.
You can sleep when monsters are nearby. They will not attack you.
-Many races with some psi power regen item can easly replenish his hp,mana and food reserves infinitely as long as he finds a bed and has learn Manna and Metabolic Control.
-You can do the same thing with ctrl+x, but as stated above will be more play-time consumptive.
-Being disturbed in bed takes more real time to finish sleeping. Dehydrated Seekers take longer to become fully rested.
-You can use trap-doors repeatedly if you sleep multiple times (or skip 200 turns) from the last usage. Be wary of your hunger level if doing this.
Known bugs and glitches.Edit
Sometimes some monsters attack you in your sleep (even destroying the bed) without waking you.