Q: I recently learned that I’m lactose-intolerant. Do I really need to avoid all dairy, or are some products safe to eat?

A: Some 30 million to 50 million people in the United States have lactose intolerance. This means their bodies can’t adequately break down lactose, the sugar present in milk.

The result can be uncomfortable gas, bloating, nausea, diarrhea and abdominal pain, symptoms that typically occur within about 30 to 60 minutes of eating a lactose-rich food, said Beth Ferrell Jenks, a dietitian and assistant professor of nutrition at the University of North Carolina at Chapel Hill.

The good news: While individual tolerances to dairy foods can vary, certain lower-lactose dairy products, like hard cheeses and yogurts, can help keep lactose intolerance symptoms at bay.

How to eat with lactose intolerance

Trouble with lactose intolerance tends to begin in adulthood, when our bodies gradually makes less lactase, an enzyme that breaks down lactose.

Some people might not notice this change in their digestion, said Dr. Suneeta Krishnareddy, a gastroenterologist at Columbia University Irving Medical Center in New York City. But others may have symptoms so severe that they experience nausea and vomiting after eating certain foods, said Dr. Nitin K. Ahuja, a gastroenterologist at Penn Medicine in Philadelphia.

Understanding your triggers involves some trial and error. You might start by eliminating all dairy from your diet, and then gradually reintroduce small amounts of certain foods and drinks containing lactose to see how you feel afterward.

The worst offenders

• Dairy milk: Skim, 1%, 2% and whole milk all contain between 12 and 12.5 grams of lactose per cup. That’s around the maximum amount of lactose people with an intolerance can consume per day without having symptoms, said Ella Haddad, a dietitian and professor emeritus of nutrition at Loma Linda University in California. So try to limit yourself to one glass of milk per day or less if you’re consuming other types of dairy.

• Unaged (or fresh) cheese: Cheese generally contains less lactose than milk, but some varieties have more than others. Cheeses that haven’t been aged — meaning they haven’t been left to ripen for weeks, months or years — typically contain more lactose than aged cheeses, Jenks said.

Unaged cheeses tend to be soft and moist and often come in a tub. A half-cup serving of cottage cheese with 2% milk fat contains about 4 grams of lactose. Two tablespoons of fat-free cream cheese has nearly 2 grams. While unaged cheeses are probably more tolerable than dairy milk, Jenks recommended limiting them when you have the choice.

• Ice cream: Many ice creams, which are mainly made from milk and cream, are rich in lactose and therefore should be limited. But some versions contain more lactose than others. If an ice cream contains more milk than cream (you can tell by checking if milk is listed before cream on the ingredients list), it is probably rich in lactose and therefore harder to digest, Haddad said.

OK in moderation

• Hard cheese: Varieties such as Parmesan, cheddar and Swiss have been aged and therefore contain very little lactose and are often easier to digest than softer, unaged varieties, Krishnareddy said. Harder cheeses tend to taste sharper and include an outer rind. A 1 1/2-ounce serving of Parmesan or cheddar, for instance, contains less than one-tenth of a gram of lactose.

• Other fermented dairy products: Fermented dairy foods like yogurt, kefir and sour cream contain bacteria that help break down lactose, Krishnareddy said.

• Butter: This kitchen staple is made from milk, cream or both by separating the fat from the rest of the liquid, leaving most of the lactose behind, Haddad said. One pat of butter and one tablespoon of cream each contain about half a gram of lactose or less.