1. Choose an activity you like 

Whether it’s brisk walking, jogging, swimming, cycling — you’re more likely to stick to your routine if you enjoy the activity. Start with low-impact exercises that won’t jostle your body too much.

2. Build your staminagradually

As you get more comfortable with your exercise routine, you can gradually work up to higher-intensity exercise. Exercises like jumping jacks, hopping in place,running stairs, and doing box jumps can strengthen your muscles, bones, joints, and ligaments.

3. Snack smarter

Because your blood sugar decreases during exercise, it’s important to have a source of energy while you work out, “Foods with protein such as protein bars and nuts are good snacks prior to exercise.

4. Stay hydrated — before, during, and after a workout

 People who get migraines regularly can experience an episode if they’re dehydrated —especially while they’re exercising. “It takes roughly 64 to 80 ounces of fluid to replace the water we lose in our bodies over the course of 24 hours,” he says, noting that these numbers can be higher if you regularly exercise and live in a warmer climate.

5. Warm up and cool down

Jumping right into your routine could trigger a migraine. Try taking a 5-minute walk before you start running, jogging, cycling; or, if you’re doing resistance training, try warming up with some light weights first.After your workout, take a 5-minute walk or do gentle stretches to help lower your heart rate and blood pressure. “This also can help eliminate some of the post-exercise muscle soreness that comes with resistance training” .

6. Keep cool

“If you’re overheated, it can trigger a migraine,”  It’s best to exercise in a cool, temperature-controlled environment. If you want to exercise outside during the hot summer months, doing so early in the morning or later in the evening, when the heat and humidity lessen. A study published in Neurology in 2009 found that the risk of migraines rose nearly 8 percent for every 9 degree rise in temperature.

7. Watch your posture

Using the wrong form while you exercise can place extra stress on your head, neck, and shoulders, which can trigger a migraine. An exercise specialist can help correct your form. You also can also get tips from online exercise videos.

8. Talk to your doctor about medication

There are medications available that can help prevent migraines — ask your doctor if you should take one. If you need to take preventative medication before your workout, talk to your doctor about the proper dose — certain medications that treat migraines can affect your heart rate, blood pressure, and muscle activity.