Intermittent fasting does not cut out food groups but it's important to follow a healthy diet while trying this popular weight-loss plan.

A good eating guide to follow while intermittent fasting is what's recommended by the Mediterranean diet.

This article was reviewed by Samantha Cassetty, MS, RD, nutrition and wellness expert with a private practice based in New York City.

This article is part of Insider's guide on How To Lose Weight.

If your goal this year is to get healthy or lose weight, chances are you may have considered intermittent fasting, an eating pattern that involves cycling between periods of fasting and eating.

While there's no technical restriction on what you can eat when intermittent fasting, some foods are better than others and will help you optimize your health and battle the hunger pains more easily.

How intermittent fasting works and what to eat

To be considered intermittent fasting, the fasting period must trigger a change in your body when energy stores in the liver, called glucose, are depleted and fat energy stores are utilized, says Mark Mattson, PhD, professor of neuroscience at Johns Hopkins.

When this happens, the fat molecules are released into the blood and enter the liver where the cells convert them into ketones. This state is called ketosis, which researchers say can be beneficial for both body and brain health.

The liver can store a maximum of about 600 to700 calories worth of glucose, Mattson tells Insider. During normal daily activities, these glucose stores are usually depleted within about ten to twelve hours of not eating, and more slowly during sleep. Every time someone eats, their liver's glucose stores are replenished.

This is why avoiding carbohydrates, particularly added sugars and refined grains is a good idea during your eating period, says Monique Tello, MD, MPH, a physician at Massachusetts General Hospital and instructor at Harvard Medical School.

A meal that's high in refined sugars and grains, such as a frappuccino and a plain bagel, is quickly broken down into sugar and won't keep you feeling full for very long. Moreover, this will cause your blood sugar and insulin levels to rise more quickly than if you ate a meal that contained fiber and whole grains like fresh fruit with a bowl of oatmeal — made from old fashioned oats, not instant oats.

"Don't worry about the sugar in a piece of fruit, go crazy, eat the fruit, it's actually full of fiber and antioxidants," says Tello. "Instead, worry about the sugar in juice, soda, coffee drinks, baked goods, as well as many [flavored] yogurts and yogurt drinks."

Consuming high-fiber foods during your eating-window will also keep you full longer because your body digests them more slowly. High-fiber foods include nuts, beans, fruits and vegetables, and high protein foods including meat. Optimal calorie intake and the specific meal plan needed for weight loss will depend upon a person's activity level and current body mass index.

Eating protein with each meal is another good strategy since protein-rich foods, like chicken, fish, eggs, and pulses (beans and legumes), also help manage hunger. A filling meal includes about half a plate of veggies, about 4 to 6 ounces of protein, a portion of starchy veggies or whole-grain carbs sized to meet your needs (often about ½ to one cup), and some healthful fats, such as nuts, seeds, or avocado. This gives you an idea of how to eat to fill up when intermittent fasting, but amounts of individual foods can vary, depending on your body and goals.

Why follow a healthy diet when intermittent fasting

If you're trying intermittent fasting to lose weight, it's still important to eat well to keep insulin levels stable and prevent spikes.

Insulin is a hormone made in the pancreas that decreases blood sugar by moving it into our cells where it can be used as fuel or stored as body fat. Research shows that a higher level of insulin prevents fat from being broken down for energy. And if you're not toned or very active, a lot of that extra sugar is going to end up in your liver where it can cause a fatty liver and weight gain.

It's also important to get enough nutrients, which can help you sleep better, regulate your mood, and offset challenging illnesses. In fact, if you're looking for a meal plan to follow while intermittent fasting, recent studies support using a Mediterranean diet for better overall health.

The Mediterranean diet encourages the consumption of fruit, vegetables, whole-grain breads and cereals, legumes, nuts, seeds, moderate amounts of fish, chicken, eggs and dairy, and red meat once a week or less. These foods provide antioxidants and anti-inflammatory substances that help keep you healthy, so it's a good eating guide while intermittent fasting.