Do you remember when everyone thought fat was the source of all dietary evil? A lot has changed. We now know that the type of fat you eat is more important than the amount of fat in your diet, and that for many people, lower-fat diets leads to poorer food choices — namely ultra-processed, fat-free or low-fat foods that are high in refined grains and sugars and low in nutrition.

Here’s the lowdown on fats and how choose them healthfully:

How much fat do you need, anyway?

The most current recommendations for fat intake are set between 20 and 35 percent of your total calories. This range helps ensure you get the amount of fat you need to protect your organs, absorb nutrients, produce certain hormones, help you regulate body temperature and more. But keep in mind that the upper end is set to make sure you also get adequate nutrients from the other macros (protein and carbohydrate), so it’s not necessarily unhealthy if you get more as long as you’re getting the nutrients you need to thrive.

One more note on fat’s functions: Aside from its role in your body, it plays an important role on your plate. Food tastes so much better when prepared with fat-filled options (like extra-virgin olive oil, avocados and nuts), and you’ll be fuller and more physically and mentally satisfied from meals that include fat.

Types of fat

There are three main types of fats: trans fats, saturated fats and unsaturated fats. Small amounts of trans fats are found naturally in some foods, but historically, the bigger problem was the manufactured trans fats that were added to processed foods. These fats are so concerning because they do double damage — raising unhealthy LDL cholesterol levels while simultaneously lowering healthy HDL cholesterol levels. Thankfully, these fats have practically been eliminated from the food supply due to a 2015 FDA ruling banning trans fats.

Saturated fat is found in foods like whole and two percent-milk dairy products (think: ice cream, yogurt and milk, and cheese), red meat and some plant-based oils, like coconut and palm oil.

There are two types of unsaturated fats: monounsaturated fats and polyunsaturated fats. Olives, avocados, peanuts, pumpkin, sunflower and sesame seeds are rich in monounsaturated fats as are the oils that come from these foods.

Polyunsaturated fats include omega-3 and omega-6 fatty acids. Notable sources of omega-3s include salmon, sardines, walnuts and flaxseeds. We consume most of the omega-6s from soybean, corn and safflower oils — often in convenience foods, like salad dressings and snack foods.

What’s the deal with butter? Is it good or bad?

Butter is high in saturated fat and in the past, saturated fat would land in the bad camp (along with trans fat) and unsaturated fats would fall in the good camp. Since nutrition is a relatively new science, we’ve learned that saturated fat isn’t necessarily public enemy number one, though some of that depends on what foods it’s coming from and how you’re eating it.

The people who live the longest, healthiest lives ... eat more monounsaturated fats and omega-3 polyunsaturated fats and fewer saturated fats.

Instead of looking at the healthfulness of each individual fat or food source (like butter), you’re better off thinking about the healthfulness and quality of your overall eating pattern. There are hundreds of published studies that point to the fact that people who live the longest, healthiest lives — with sharp memories and healthy hearts — eat more monounsaturated fats and omega-3 polyunsaturated fats and fewer saturated fats as a part of a menu that’s centered around plant foods, including beans, nuts, seeds, whole grains, fruits and veggies. This type of eating pattern is practiced on the Mediterranean Diet as well as the Nordic Diet and many forms of plant-based eating patterns. The collection of nutrients on these types of eating plans — which include the types of fats selected — lower the body-wide inflammatory process and fill you with antioxidants, both of which can counter many disease processes.

Studies link eating this way to numerous benefits, including a lower risk or better management of type 2 diabetes, better weight management, improvements in body composition with a reduction in dangerous belly fat, a lower risk of heart disease, and a lower risk of memory loss and cognitive decline as you age.

So is butter good or bad? Butter doesn’t promote health in the same way that extra virgin olive oil or avocado oil does, but if you enjoy it sometimes in addition to the other healthful foods and fats mentioned here, I’d call it neutral. Generally, though, extra virgin olive oil and avocado oil are healthier cooking oils.

What about full-fat yogurt?

Many government and health authorities recommend choosing reduced- and low-fat dairy products because of their lower saturated fat content. But this advice might need a fresh look. Saturated fats are made of different fatty acids, and the saturated fat profile of dairy foods looks different than that of meat or other foods.

The past decade of research has hinted at the fact that the source of saturated fat in your diet — say, dairy compared to red meat compared to a plant-based source, like coconut — may be more important than just keeping your totals down.

One study that tracked nearly 3,000 older adults for a period of 22 years found that the main fatty acids from dairy foods were linked with a lower risk of death from heart disease. People with higher levels of these fatty acids (which suggests they eat more high-fat dairy foods) were also much less likely to die from stroke.

This adds to a growing body of evidence suggesting that the saturated fat from dairy foods might not be as harmful as we once thought. Again, we have to look at a whole food (and the whole diet) and not just the sum of its parts. Let’s look at this in context: If you’re choosing between an unsweetened whole milk yogurt or a bag of chips, the whole milk yogurt (unsurprisingly) gets my vote.

And those anti-inflammatory fats?

When your body has an overactive inflammatory process, it ups your risk of most of the diseases you’re concerned about, like heart disease, arthritis, type 2 diabetes, cancer and Alzheimer’s disease. The fats from foods, like olive oil, nuts and seeds and fatty fish (like salmon and sardines) help calm this response.

But some fats trigger this overactive inflammatory response, so it’s also important to reduce your consumption of them. These omega-6-rich oils — the polyunsaturated oils, like soybean, corn and safflower oil — are found mainly in processed, convenience foods. A form of these fats is also found in factory-farmed animals who graze on grains instead of grass. We consume about 20 times the amount of these fats compared to the anti-inflammatory omega 3 fats — a balance that’s way off from the 1:1 ratio that we evolved to consume.

To create a healthier balance and calm internal inflammation, look at the ingredient list in oil-containing foods and choose ones with anti-inflammatory oils, like extra virgin olive and avocado oils. These should be your go-to cooking oils, too. When possible, choose grass-fed meat and pasture-raised eggs for their higher omega-3 and lower omega-6 contents. And of course, regularly eat nuts, seeds and oily fish (if you aren’t vegan or vegetarian) for their anti-inflammatory fats. Keep in mind, though, that it’s not just about the fats you eat; you also need to cut back on other foods, like processed grains and added sugars, that promote inflammation.

How healthy is a high-fat plan, like keto?

There’s solid evidence that you can lose weight on a keto diet, but there’s also evidence that the diet is difficult to sustain and therefore, any weight lost could be regained. This, of course, can happen with any fast fix or plan that doesn’t match your lifestyle.

One thing to watch for on a high-fat keto plan is ketosis, which is a normal metabolic process that occurs when your body has restricted access to carbs (its preferred energy source). When you initially hit ketosis, you’ll likely experience some pretty crummy side effects, like bad breath, constipation, headache, rash, weakness and exhaustion. This collection of symptoms has been deemed the keto flu. They should pass once your body adapts, but many people have a hard time making it through this phase.

If your keto weight loss is sustainable, makes you feel good, and results in healthy lab measurements (blood pressure, blood sugar, cholesterol, inflammatory markers and others), then it may be healthier than what you were doing before. But keep in mind that evidence points to the fact that when you replace carbs with animal foods, it’s linked to a higher risk of death, so the healthiest form of keto involves replacing them with more plant foods (think: nuts, seeds, and avocados).

Still confused about fat?

If you’re still confused about fat, it might be simpler to stop thinking about it in isolation. When you eat, you don’t sit down to a plate of saturated fat, monounsaturated fat, etc; you sit down and enjoy food. So rather than boiling down your plate to numbers and percentages and things you learned in chemistry class, consider your overall eating pattern. A little butter or some fat-filled yogurt isn’t going to make or break consistently healthy eating habits that include generous portions of colorful veggies along with fruits, whole grains, beans, and fats from fish, nuts, seeds, olives, avocados and their butters and oils.

WHAT A NUTRITIONIST WANTS YOU TO KNOW

Want more tips like these? NBC News BETTER is obsessed with finding easier, healthier and smarter ways to live. Sign up for our newsletter and follow us on Facebook, Twitter and Instagram.