Human body needs to maintain its temperature at 37 degrees centigrade with a margin of about plus or minus 0.5 degrees. Body achieves this standard temperature for the body irrespective of the environmental temperature by a process known as homeostasis. To maintain the the body temperature at the standard body temperature the amount of heat gained and lost by body needs to be balanced by the homeostasis process.
The body gains heat in the process of converting food into energy. In this only about 10 percent to 25 percent of the energy is converted to work and id the rest is converted to heat energy which the body must dissipate. The body loses energy by convection of air and by radiation when the environmental temperature is lower then the body temperature. Body also gives out excess heat by the evaporation of sweat.
Body needs to loose extra heat when engaged in activity due to production of extra heat in the metabolic process. At the same time in very cold environment the body looses too much heat to the environment, and to maintain the body temperature it mus t produce extra energy through increase in metabolic rate.