These include simple management and prevention strategies and learning more about your condition and how it affects you.

This article includes ways to lessen pain when it strikes, lifestyle changes that can help you prevent headaches and migraines, and some helpful things to do between attacks.

You may find that soothing sounds can relax you while also blocking out aggravating noises like traffic or the buzz of electronics. Try a fan, soft nature sounds, or calming music. Lots of apps and online videos offer sounds designed to counter migraines.

Some essential oils, used for aromatherapy, may help ease head pain or be soothing. However, fragrance sensitivities cause headaches in some people, so make sure you’re not sensitive to them before you try them to treat a headache.

Essential oils with some scientific evidence for helping headaches or migraines include:

PeppermintLavenderBasilAngelicae Dahuricae RadixChuanxiong RhizomaChamomileAniseGarlicRose

Motortion / Getty Images

Cold applied to the forehead and temples is common choice for migraines. Heat, applied all over or on the neck/back of head, is more popular among people with tension headaches.

Wearable heating and cooling packs and other devices are available. Topical products like Icy Hot may also help.

Grace Cary / Getty Images

A 2017 study showed 130 milligrams (mg) of caffeine makes painkillers work better against tension-type headaches. You can get that amount in 2 ounces of espresso, a 12-ounce cup of coffee, or some energy drinks.

Tea and soda typically contain lower levels of caffeine. So you’d need several servings to reach 130 mg.

Some headache medications include caffeine, as well.

However, if you consume caffeine regularly, the effects may diminish over time. Also, caffeine withdrawal often causes a headache.

Caffeine may be a trigger for chronic daily headache (CDH) in some people, though. People who have occasional migraines are more likely to develop CDH when they take in caffeine on a daily basis.

It may be worth experimenting to see if caffeine aggravates or relieves your headaches.

Set aside a period of time every day that’s dedicated to relaxation. You can use this time to:

Meditate Listen to a relaxation or meditation app Do yoga or tai chi Take a bubble bath Sit quietly doing nothing

Use this time to focus on you, how you’re feeling, and what you need. This self-care will pay off, leaving you more relaxed and aware of yourself.

If you don’t feel rested after a night’s sleep or you experience excessive daytime sleepiness, talk to your healthcare provider about having a sleep study to rule out sleep disorders.

Replacing processed foods with fresh alternatives that reduce inflammation can go a long way in preventing head pain. A short-term elimination diet can also help you identify any dietary triggers, such as fast food, which may contribute to headaches in some people.

Optical-grade lenses don’t have the distortion that some inexpensive lenses have, and polarization is essential for cutting glare. Wear them whenever the light is bothersome, even if it’s indoors.

Add a baseball cap when light comes in above the sunglasses so the cap’s bill can block that light. Your eyes (and your head) will thank you.

Water is best. Some fruit juices and caffeinated drinks can trigger headaches and migraines.

Proper hydration is essential to good health in general, so you’ll be working on more than just head pain prevention by doing this.

Stress can trigger tension headaches and contribute to migraines, so try your best not to stress over the small stuff. Learn to prioritize and do what you’re able to do each day without stressing.

Good overall health is essential when you’re struggling with any specific health problem. If you stay generally healthy, you may even help yourself contain your head pain.

An important component of both good health and pain management is regular exercise. So is maintaining a healthy weight, as being overweight increases the risk of chronic headaches.

Educate yourself on head pain causes, symptoms, and treatments. It’ll allow you to better care for yourself and understand what your healthcare provider says about your condition and treatment. Keep a daily headache and migraine diary including what you eat, activities, and other factors that may lead to head pain. It can take up to 48 hours for a trigger to cause a headache or migraine, so a careful diary may help reveal patterns. Find a support group in your community or online so you have understanding people to vent to and learn from. You’ll feel less alone and could pick up valuable information.

Beneficial lifestyle changes to prevent headaches include getting enough sleep, eating a healthy diet, wearing sunglasses, staying hydrated, managing your stress, staying active, and maintaining good overall health.

It also helps to learn about your condition, identify your triggers, and find a support system.