These lifestyle changes may prevent migraines, according to the National Headache Foundation:
Avoid triggers. If certain foods, odors or situations have triggered your headaches in the past, avoid them.
Exercise regularly. Aerobic exercise reduces tension and can help prevent migraines.
Don't smoke. Smoking can trigger headaches or make them worse.
Get enough sleep. Try to get seven to nine hours a night.
See a counselor or therapist who can teach you techniques for managing stress and coping with pain.