Research shows that working swing, rotating or permanent night shifts can cause a long list of problems for both body and mind. However, those kinds of hours are a painful reality for many, especially those working in hospitals and other health-care settings. Shift work can disrupt circadian rhythms, affect the body’s production of melatonin and predispose workers to illnesses such as cancer, heart disease and depression, so it’s more important than ever to commit to the three mainstays of good health: eating well, resting well and getting exercise.

1. Rethink Your Meals

Shift work typically disrupts eating patterns. Overeating or eating unhealthy foods from cafeterias and vending machines can lead to unintended weight gain. Plan ahead for a couple of mini meals to eat while you’re on shift rather than consuming big meals before or after and snacking while you’re on the job. Pack a lunchbox with quick, healthy foods you can grab anytime.

2, Stay Hydrated, Not Caffeinated

To stay awake and alert on night shifts, all too many people turn to caffeine. But caffeinated drinks can cause dehydration, raise blood pressure and interfere with sleep patterns once you leave work. A few caffeinated beverages won’t hurt, but balance them with non-caffeinated drinks such as mineral waters, herbal teas and just plain water. Avoid caffeine altogether toward the end of your shift so you can fall asleep when you get home.

3. Avoid the “Day Trap”

When you’re working off-hour shifts, your schedule is just the opposite of the way most of your family and friends live. It may be tempting to join them for regular daytime life once you’re off work, but outside of the occasional lunch with friends or special event, you should establish a quiet daytime routine that lets you get the rest you need.

4. Work in Exercise Whenever You Can

Your night shift job may include plenty of walking and other physical tasks, but if it doesn’t, use break time to move around. Walking corridors, taking stairs or even just stretching at your desk can relieve stress, boost your metabolism and keep you alert.

5. Keep a Consistent Schedule

On weekends and other off-shift days, it may be tempting to upend your schedule to accommodate all the activities you’ve missed out on while working. However, straying too much from your night shift schedule can make it harder to adjust when you return to work.

Shift work doesn’t have to ruin your health. Staying consistent and bringing healthy habits to work can make it possible not just to survive, but to thrive, on the night shift.