As humans, we are naturally diurnal, being awake during the day and sleeping at night. In fact, light and darkness play a large role in regulating the timing of our wakefulness and sleep. We are designed, under normal circumstances, to sleep when it becomes dark and to be awake when it is light.
Light perceived by our eyes signals a small part of our brain called the suprachiasmatic nucleus, which is the main pacemaker of our body clock. In this way, the light-dark cycle of our surroundings has a strong effect on the timing of sleep and wakefulness during each 24-hour period. This is called the circadian process of sleep regulation. The same phenomenon regulates our body temperature rhythm and many other internal biological rhythms.
Sleep is also regulated by the amount of time we have been awake. Broadly speaking, the longer we are awake, the more our sleep drive builds up. This is called the homeostatic process of sleep regulation. Together, the circadian and homeostatic processes help us to have good sleep when they operate without interference. This is called the two-process model of sleep regulation and was first proposed by Dr. Alexander Borbély.