Your body is constantly undergoing a process called homeostasis, which is ultimately just regulating a stable environment for your cells, to put it very simply. Your body is capable of cooling itself down when too hot by vasodilation (dilating blood vessels). This causes vessels to be closer to the surface of the skin, which encourages sweating and thus evaporation to occur. The evaporation of your sweat is the thing that keeps you cool because of the way heat energy is transferred away.
The opposite happens when you feel cold. Vasoconstriction (constricting blood vessels) occurs to bring blood to your vital organs, away from our skin so we stop sweating so much.
This somewhat explains why frostbite happens.
Edit: thermoregulation (the process by which your temperature is controlled) is controlled by the part of your brain called the hypothalamus
Latest Answers