Sleep is the process in which humans periodically rest, unconscious and unaware of the surrounding world. Sleep occurs cyclically, roughly every 24 hours even though the average human inner body clock runs a 24.3-hour cycle. The 24.3-hour cycle gets reset daily (to match 24 hours) with various stimuli such as the light.
Though there is still much debate about the evolutionary origins and purposes of sleep, it is well known that one major function that occurs during sleep is consolidation and optimization of memories. Sleep proceeds in cycles of NREM and REM phase. Each phase has a distinct physiological function. Some medications (for example, sleeping pills) can suppress selective stages of sleep. This can result in obtaining sleep (loss of consciousness) without fulfilling its physiological function (memory remolding).
A majority of sleep disorders which originate within the body (for example, insomnia, DSPS, ASPS) result from errors in synchronization of sleep with the body clock. Only a fraction of sleep problems are organic and cannot be resolved with chronotherapy. One of the simplest solutions towards getting good sleep is free-running sleep. In simple terms, free-running sleep requires throwing away your alarm clock. Free-running sleep can resolve majority of synchronization-dependent sleep disorders, but usually cannot be employed due to the resulting loss of synchronization of sleep with the outside world (including day-night cycle).