1. Our body sweats to keep the body cool by evaporation.
2. We know that process of evaporation is endothermic and absorbs heat from the surroundings. Thus, making the surroundings cooler.
3. So, like water from lakes evaporate to keep the earth cool, the sweat released from pores of our skin evaporate to prevent the temperature of body from rising.