A healthy diet—one with abundant quantities of produce and whole grains, and moderate amounts of “good” fats and lean protein—can help prevent and control chronic conditions such as diabetes and heart disease. But certain foods can have a more immediate benefit and may help tame common health problems such as headaches and insomnia. So the next time you experience one of the conditions below, consider heading to your kitchen before you open your medicine cabinet.

Sip Away Headaches

Whether you have headaches frequently or only occasionally, “the first thing to do if you get one is drink a tall glass of water or two,” says Robin Foroutan, M.S., R.D.N., an integrative nutritionist in New York City and a spokeswoman for the Academy of Nutrition and Dietetics. “Dehydration is a common cause of headaches, so water may address the pain right away.”

Having a snack with a combination of carbs, protein, and healthy fat may also help because it prevents blood sugar dips, which can trigger headaches, Foroutan adds. A good combo snack is an apple with a handful of walnuts.

Consider, too, whether you’ve had your usual dose of caffeine in the past couple of days, because caffeine withdrawal can cause headaches. In addition, blood vessels may enlarge during a headache and caffeine can constrict them, so coffee or tea might offer some relief, the National Headache Foundation says.

For some people, however, caffeine can set off a headache, so if that happens to you, skip the java. But if you experience migraines, be aware that food reputed to trigger those headaches—aged cheese, cured meats, chocolate, artificial sweeteners, MSG, and soy—are to blame much less often than you might think.

“The prevalence of food triggers is really overstated, but people who have them tend to figure it out pretty quickly,” says Mark W. Green, M.D., director of the Center for Headache and Pain Medicine and a neurology professor at the Icahn School of Medicine at Mount Sinai in New York City. “Alcohol is the one exception; it’s more likely to cause a headache than other foods, especially if it’s heavily fermented, such as red wine.” And if you suspect that certain foods bring on your headaches, keeping a food diary can help you pinpoint dietary culprits. 

Calm Nausea With a Spice

Ginger has been extensively studied as a potential remedy for nausea, especially during chemotherapy and pregnancy. A 2016 review of research, published in the journal Integrative Medicine Insights, found ginger to be effective and safe. It seems to help by moving food out of the stomach quickly, and possibly turning off neurotransmitters such as serotonin that can contribute to nausea.

To make yourself some ginger tea, steep 1½ teaspoons of freshly grated ginger in 1½ cups of boiling water (add honey if you like). Let it sit for 10 minutes, then strain the ginger out before drinking.

And don’t think you have to stick with rice and dry toast after a bout of nausea. William Chey, M.D., a gastroenterologist and professor of medicine and nutrition at the University of Michigan, Ann Arbor, says evidence doesn’t support long-standing advice to eat only bland foods. He recommends small, frequent meals rich in protein, especially chicken and fish, and vegetable proteins.

“Red meat is hard to digest,” Chey says. “There are other proteins that seem to move through the stomach more quickly.”

“Plus they don’t cause the same gastric sensations that fats do,” he adds. Fats can make the stomach overly sensitive, leading to pain, fullness, and nausea.

Snack Away Your Insomnia

Some people suggest sipping warm milk for insomnia because it contains tryptophan, an amino acid that is converted to serotonin, which will relax you, and melatonin, which promotes sleep. But studies haven’t proved that.

“It might help some people because it’s a calming ritual, not because of the tryptophan,” Foroutan says.

Instead, you may want to try snacking on two kiwis an hour before bedtime. A 2016 review of studies published in Advances in Nutrition concluded that the fruit may promote sleep because it’s a rich source of folate, a B vitamin that may help the brain produce sleep-inducing chemicals.

Kiwi's high antioxidant content may also be a factor. Those plant-based chemicals combat oxidative stress—cell and DNA damage from factors such as sun exposure, smoking, and pollution—which has been linked to sleep problems. But more research is needed on the kiwi-sleep connection.

Zap Heartburn With Fruit

The typical dietary advice for fighting heartburn and gastroesophageal reflux disorder (GERD)­ is to eat smaller, more frequent meals, skip spicy foods, and avoid eating or drinking within 3 to 4 hours of bedtime.

The problem is that it only helps reduce the likelihood of future attacks. Once the burning sensation strikes, try having a banana. Some research suggests that the fruit may act as a natural antacid.

Another remedy: Chew sugarless gum. Studies have found that it may decrease reflux after a meal.

Long term, consider cutting back on your consumption of sugars. A 16-week study of obese women, published this year in the journal Alimentary Pharmacology and Therapeutics, found that reducing refined carbohydrates, especially sucrose (table sugar), eliminated symptoms in those who complained of GERD at the start of the trial.

“The diet resolved reflux in all 43 women who had it by week nine or 10, and it wasn’t just because of the weight loss,” says Heidi Silver, R.D., Ph.D., a research associate professor of medicine at the Vanderbilt University Medical Center and one of the study’s authors. In particular, it found that every additional teaspoon of sugars increased the odds of having GERD by 13 percent.

Feed a Cold

No foods are a proven remedy to shorten a cold, but some may help ease sneezing, a sore throat, and a stuffy nose caused by inflammation. “Your body needs antioxidants during a cold, so eating more fruits and vegetables is key to feeling your best,” Foroutan says.

What about chicken soup? A study published in the journal Chest many years ago found that chicken soup made with a sweet potato, turnips, and other healthy ingredients did a better job of reducing inflammation than plain chicken broth. (Store-bought brands worked, too.) Soup is also hydrating, which helps your lymph system flush out the virus.

But you may want to avoid sugars when you have a cold. “There’s some research showing sugar weakens the activity of certain [virus-fighting] white blood cells,” Foroutan says. “Plus you need a lot of nutrients to keep your body strong during a cold or flu, and sugary foods take the place of healthier options.” 

Editor's Note: This article originally appeared in the December 2016 issue of Consumer Reports on Health.