Staying in shape during the summer is easy, right? You can finally go for a jog or play a sport outside. But what about when it’s too hot? These tips will help you stay safe when breaking a sweat during the summer, or even find an alternative to being in the sun.

Tips for exercising outdoors

1. Stay hydrated

Drinking enough water is perhaps the most important part of working out, as even mild dehydration can cause headaches, dizziness and fatigue. As a rule of thumb, aim to drink half of your body weight in ounces everyday. During your workout, don’t forget to stop for a water break every 15 to 20 minutes.

According to WebMD, you should follow these guidelines:

— One to two hours before your workout, drink 15 to 20 ounces of water

— 15 minutes before you begin, drink between 8 and 10 ounces of water

— During your workout, drink another 8 ounces every 15 minutes.

2. Dress cool

The summer months may be time to put away your favorite pair of workout leggings. Opt for lightweight, breathable materials and try to include a hat to shield your face from the sun, if possible. Stay clear of dark-colored clothing as it will only attract the heat and make you more prone to overheating.

3. Start slow

For your first workout of the summer, don’t go all-out right away. Take it slow and let your body get used to the heat gradually. For example, go for a 15 minute jog the first day, a 20 minute jog the second and so on.

4. Eat right

Before your workout, eat foods that contribute to your fluid intake, such as cucumbers, strawberries and watermelon. After your workout, replenish the salt you lost through sweat with salty snacks such as nuts or olives.

5. Listen to your body

If your body is telling you it’s time to stop, it’s time to stop. Don’t ignore feelings of nausea or dizziness and know when it’s time to end your workout early if you need to. Signs of heat stroke include headache, dizziness, disorientation and fatigue.

6. Work out in the early morning or late afternoon

Try to schedule your workout for cooler parts of the day — early in the day or in the late evening. The sun won’t be so unbearable and it’s much easier to avoid any heat-related issues.

7. Don’t forget the sunscreen

Protect your skin, too. Make sure to cover your body in a sunscreen that has at least a 45 SPF to block harmful rays from the sun during your workout session. Also, consider wearing a visor that will shield your eyes and skins from the sun when exercising.

Some indoor exercise alternatives

1. Swimming

Why not skip the jog and take a dip in the pool instead? A 150-pound person can burn 400 calories just through leisurely swimming for one hour, according to WebMD. Plus, it’s fun, works out the whole body and a great way to stay cool!

2. Do indoor workouts

Skipping cardio and doing strength training indoors instead can be a great workout. Using either your body weight or dumbbells, workouts like lunges, burpees, deadlifts, squats and planks can easily be done in the comfort of your home.

3. Yoga

Get zen and avoid the heat by practicing yoga. Countless videos can be found online to follow along with, and yoga burns calories, tones muscles and promotes flexibility.

4. Pilates

Pilates is a great way to get your heart rate up in a short amount of time and focuses on using your body weight to strengthen muscles. It can be done indoors with nothing but a mat and motivation.

5. Go to the gym

Summer months are some of the slowest for gyms, as people turn to the outdoors for exercise instead. Fewer fitness club goers could make it easier to get to your favorite equipment, or find an open slot in a popular class. Gyms often offer specials for enrollment during this time, too, and it’s easier to score a great deal on a membership.

6. Take a class

Great for following a schedule and socializing, taking up a class at a studio such as kickboxing or yoga can help you stay on track. Like gyms, many studios offer specials on classes, so why not try something new and sign up for one?

Theresa King, USA TODAY Network