
Eric M. answered 06/27/20
Experienced Math/Science Tutor with Medical Degree
Energy can only be transferred out of your head via heat in the form of via radiation, conduction, or convection.
Radiation is due to the emission of electromagnetic waves, which is likely minimal from your head. Conduction requires physical contact with a solid that facilitates transportation of heat along a gradient. Unless your head is resting on a cool wall or something, this is also likely minimal.
Convection is where most of your heat energy is lost. Your body is at 98.6°F, which is usually warmer than the air around you. The air near your head absorbs some of this heat and then travels upwards/away, allowing other room-temperature air to replace it and repeat the process. By wearing a hat, there is a thin cushion of air between the hat and your head that is warmed but unable to move away. This warm air provides a barrier to the convection process, and reduces the rate of heat transfer away from your head.