Human beings are endotherms that is, their body temperature remains constant irrespective of the surrounding temperature.
In order to maintain the body temperature, at very hot conditions in summer, heat loss is increased by releasing more sweat.
The water in the sweat evaporates by absorbing heat from the skin thereby cooling the surface of the skin. So, sweating is one of the internal mechanism of body to regulate temperature.