Being stuck on an airplane for hours at a time can be draining and irritating ― especially if you’re sharing a cabin with a sick passenger who can’t seem to stop coughing every 15 seconds.

And the nuisance can last long after your flight: A 2017 Annals of Global Health study found that passengers sitting in the row directly in front of and behind an ill person are most likely to get sick.

When you’re in close proximity to a lot of people for a long amount of time, you’re generally exposed to more germs than usual, said Stephanie Mandel, a holistic nutrition consultant at The Morrison Center in New York. That increased risk, along with environmental factors, can create a playground for a potential cold.

“The air [on a plane] is dry, which dries out your nasal passages and throat, making it harder for your natural defenses, like mucus, to do their job and remove germs,” Mandel said.

Have no fear, however: You can help prevent yourself from coming down with a nasty cold. HuffPosttalked to some experts for their advice:

1. Wash your hands.

Remember in kindergarten, when your teacher stressed the importance of washing your hands before and after pretty much anything? Those same rules should apply when you’re flying.

Daniel Eiras, an assistant professor of infectious diseases and immunology at New York University’s Langone Health, said the No. 1 thing you should do on the plane is wash your hands.

“This should be with hand sanitizer or with soap and water, but it should be thorough, making sure to include frequently missed areas like the back of the hand and under the fingernails,” Eiras said.

“These items are generally not disinfected between flights, and are frequently the most contaminated surfaces on the airplane,” he explained.

2. Choose your seat wisely.

This one can be a little tricky. While it’s impossible to know if someone on your plane is going to have a cold or where they’ll sit, the chances you’ll get sick go up if you choose an aisle seat. Data shows a person sitting in an aisle seat has an 80 percent chance of getting sick if there’s an ill passenger in the aisle seat directly across from them, Business Insider reported.

In a 2018 study in the Proceedings in the National Academy of Sciences, a Boeing engineer also deemed the air in the back of a plane the “dirtiest air in the cabin.” (But don’t get too hung up on that. All of the air on a plane is filtered through HEPA filters, which are the same type of filters that hospitals use.)

3. Get some rest.

And not just on the plane. Experts recommend getting a good night (or day’s) rest before boarding.

“You should always make sure you get sufficient rest before you travel,” said Marina Gafanovich, a New York City-based internist specializing in travel and internal medicine. “If you are stressed and exhausted, your body is more vulnerable to illness.”

Sleeping after your flight is also important, according to Gafanovich, since jet lag can affect your healthy routine.

“Sleep as per the time in your destination,” Dr. Ganovich added. “If your flight lands at night, go to bed. If it’s daytime, try to stay awake so that you sleep on time and wake up the next day fresh and alert.”

4. Eat healthy food.

Before you load up on pizza and cupcakes right before your flight, consider healthier options that will help strengthen your immune system. Sugary foods can decrease the number of immune system cells that fight off bad bacteria, according to Livestrong. Mandel suggested eating antioxidant-rich foods like berries and leafy, dark green vegetables.

“All the studies to date that have looked at supplements like vitamin C, echinacea, zinc, ginger and other herbs have basically demonstrated no benefit in terms of preventing colds, or making colds shorter,” Eiras said. “At best the supplements are ineffective, but it is also important to know that they may also cause health issues of their own, such as causing nausea and headaches, or by interacting with other prescription medications.”

5. Don’t get on a plane if you’re sick.

While this may seem obvious, already having a cold or the flu and getting on an airplane probably isn’t the best idea. The U.S. Centers for Disease Control and Prevention recommend not flying if you’re suffering from an illness that you can easily spread to others.

“Flying can exacerbate your illness,” Gafanovich said. “Also, if your illness is communicable, it can also cause other people harm.”

According to the CDC, some airlines may even check to see if you look sick while you’re in the waiting area or boarding. If you have an ear infection or cough or cold symptoms, you should skip the flight if you can.