Whether you’re working, running, playing sports or hiking in the hot weather this summer, be careful out there: Don’t overdo it.

When the mercury climbs towards 90, it’s much easier to overexert yourself. When combined with dehydration, this can lead to heat stress.

“Heat-related illnesses are a result of the body’s attempt to keep itself cool,” said Geisinger sports medicine specialist Justin G. Tunis, M.D. “Your body temperature rises faster when you’re out in the heat, which can cause cramps, heat exhaustion or heat stroke.”

Heat cramps are a mild heat-related illness that can temporarily sideline you from physical activity in the hot weather.

“When you sweat too much in the heat, your body loses salt and water, which can cause brief, but painful, muscle spasms,” said Dr. Tunis.

You’re most likely to experience heat cramps in large muscles in your legs, shoulders or back. If you feel sudden pain, stop what you’re doing and stretch or gently massage the muscle. You should also hydrate with water or a sports drink.

Continued exertion may lead to more severe heat-related issues—heat exhaustion and even heat stroke.

“Heat exhaustion occurs when you’re body struggles to keep its core temperature of 98.6 degrees,” said Dr. Tunis. “Your body loses water and electrolytes, causing you to sweat heavily, have an elevated pulse, or feel dizzy, weak and fatigued.”

You may also experience goosebumps and feel cold even while you’re still out in the heat.

If you experience these symptoms, it’s important to stop immediately to cool down and rest. Drink water or a sports drink with electrolytes to hydrate. You may also want to take a cool shower or bath, or apply cold compresses until symptoms subside.

If you ignore the signs of heat exhaustion, it could progress to heat stroke, which is a life-threatening condition.

“Heat stroke occurs when your body temperature rises to 104 degrees,” said Dr. Tunis. “Someone is experiencing heat stroke if they are dizzy, nauseous or vomiting, confused, have blurred vision and a rapid heartbeat, and stop sweating.”

In the most severe cases, someone experiencing heatstroke may become unconscious.

If someone is exhibiting signs of heat stroke, call 911.

Then, move them to the shade or indoors immediately and cool them down in a shower or bath. If that isn’t available, cool, wet towels placed on the forehead, neck, armpits and groin can help lower a person’s body temperature quickly until medical help arrives.

The key to avoiding heat-related illnesses is focusing on hydration before and during working or exercising in the heat.

Drink 17 to 20 ounces of fluid before working out.

Take a break every 20 minutes and drink seven to 10 ounces of water, fruit juice or other beverages with electrolytes, such as sports drinks. Avoid drinks with caffeine.

When you’re done working in the heat, drink another 8 ounces of fluid.