We know what we should eat. Trouble is, most of us have a hard time sticking to it.

Researchers are racing to understand what pushes people to make healthier food choices. They are finding that broad resolutions to “eat better” are less effective than setting a couple of smaller rules, that eating with other people is helpful and that grocery shopping online can be better than going to the store. 

The issue is urgent: The number of Americans who are overweight or have obesity is rising. Nearly three-quarters of U.S. adults ages 20 and older are overweight or obese, according to 2017-2018 figures from the Centers for Disease Control and Prevention, and some surveys have found that obesity rates rose further during the pandemic.

Doctors and scientists broadly agree that a healthful diet is rich in vegetables, fruits, whole grains and lean meat and poultry—and is composed of fewer foods linked to poor health, including sugar-sweetened foods and drinks, refined grains and large amounts of red meat. Yet most of Americans don’t consume the recommended amount of vegetables, and three-quarters overeat refined grains, such as white bread, according to a government report.

“We’re living in a time where there’s food everywhere. You go to buy a hammer and there’s soda in the checkout line,” says Erica Kenney, assistant professor of public health nutrition at the Harvard T.H. Chan School of Public Health. “People berate themselves, but they are fighting against the environment.” 

Whether you are trying to overhaul your diet, resist the peanut-butter cups in the checkout aisle or maintain the good habits you already have, research suggests some ways to make healthy eating easier.

Set one or two specific rules, and stick to them.

People are more likely to act on a plan if it consists of simple steps, psychology research has found. Having one broad goal—such as, “I’m going to eat better”—generally isn’t effective.

Pick one or two specific eating rules and stick to them—and think of yourself as someone who doesn’t do those things. For instance: I don’t consume sugary drinks. Or I don’t eat fried foods. Or I don’t eat dessert during the week.

Restricting yourself in multiple ways makes it harder to stick with good intentions, says Christina A. Roberto, associate professor of health policy at the University of Pennsylvania’s Perelman School of Medicine. 

Conversely, setting a rule “just takes the decision out of it,” says Deborah F. Tate, professor at the Nutrition Research Institute at the University of North Carolina. 

Make a grocery list, and shop online. 

Making a shopping list of healthful foods can encourage you to avoid impulse buys when you are at the store, says UNC’s Dr. Tate. 

Shopping for groceries online might be even more effective since unhealthy items aren’t right in front of you. Research has found that people tend to make better food choices farther in advance of eating, so the delay between making an online order and receiving it could be helpful, Dr. Roberto says. 

People looking to lose weight who shop online buy fewer high-fat foods and fewer items overall compared with those who shop in person, according to a 2007 study in the International Journal of Behavioral Nutrition and Physical Activity that followed 28 participants over eight weeks. 

One caveat: Be wary of online ads trying to persuade you to buy items you didn’t plan to purchase. That marketing can derail your good intentions. 

Good sleeping begets good eating.

Not sleeping enough (generally less than six-and-a-half hours a night) is linked to weight gain, scientific studies have found. Sleep experts generally recommend that healthy adults get between seven and nine hours of sleep a night. 

SHARE YOUR THOUGHTS

What are your tips for establishing healthier eating habits? Join the conversation below.

When we are awake longer, we have more time to eat. And there are biological changes that occur when we don’t sleep enough that can lead to overeating.  

“Some research suggests there are potential changes to appetite-related hormones when we have short sleep,” says Alyssa Minnick, a postdoctoral fellow in the Division of Sleep Medicine at the University of Pennsylvania’s Perelman School of Medicine. When we are sleep-deprived we tend to crave more high-fat foods, too, she says. 

Penn researchers found that study participants allowed to sleep just four hours a night for five nights ate on average an extra 550 calories daily. The paper was published in 2013 in the journal Sleep. More recent research has had similar findings. 

Don’t eat alone. 

When we eat with family and friends we tend to make more well-rounded meals with vegetables, proteins and other components, says Barbara J. Mayfield, a registered dietitian in Delphi, Ind. We also tend to eat more slowly, and often mindfully, when with others, she says, making us better able to notice when we are full. 

Eating with others who are also committed to healthy eating can help us achieve our goals, says Rebecca Seguin-Fowler, associate director of the Institute for Advancing Health Through Agriculture at Texas A&M University. You are more apt to skip dessert when your dining companions are too, she says. 

Studies have found that when one person in a household is trying to improve their diet and lose weight, the other members lose weight too, even if they aren’t trying to, says Amy Gorin, interim vice provost for health sciences at the University of Connecticut.

Write to Andrea Petersen at andrea.petersen@wsj.com