Through a process known as thermoregulation, the temperature of our body is controlled by mechanisms such as shivering, sweating, and changing blood flow to the skin, so that body temperature fluctuates minimally around a set level during wakefulness. Just before we fall asleep, our bodies begin to lose some heat to the environment, which some researchers believe actually helps to induce sleep. During sleep, our central set temperature is reduced by 1 to 2°F. As a result, we use less energy maintaining our body temperature. It has been hypothesised that one of the primary functions of sleep is to conserve energy in this way.
Body temperature is still maintained, although at a slightly reduced level during non-REM sleep, but during REM sleep our body temperature falls to its lowest point. Curling up in bed under a blanket during the usual 10- to 30-minute periods of REM sleep ensures that we do not lose too much heat to the environment during this potentially dangerous time without thermoregulation.
Source: Division of Sleep Medicine at Harvard Medical School, 2016