Core body temperature is regulated by circadian rhythm.
Our body temperature is higher during the day and declines at night. In normal sleepers and normal conditions, sleep onset occurs as a person’s body temperature falls and his or her heat loss increases — these changes also prompt the maintenance of sleep. (This is why exercise should ideally occur four to six hours before bedtime, in order to ensure that the person’s core temperature is not elevated when they try to go to sleep.)
Body temperature continues to decline during sleep until about 4:00 AM, when it starts to rise again. People usually wake up during this rising part of the circadian rhythm, as the body warms up and stops losing heat.55