Many of our most vexing problems, from overeating to not saving enough for retirement to not working out enough have something in common: lack of self-control. Self-control is what gives us the capacity to say no to choices that are immediately gratifying but costly in the long term—that piece of chocolate cake (instead of an apple), that afternoon in front of the couch (instead of a visit to the gym). Despite our best intentions, we often fail to meet our lofty goals.

The problem of self-control has puzzled psychologists and behavioral scientists for decades. A great deal of research has identified situations in which self-control failures are likely to happen and tools to help people exercise better control. For instance, research has found that people persist for longer on tasks that require self-control when they know they’ll be paid for their efforts, or when they are told that their work will benefit others (such as helping find a cure for Alzheimer’s disease). These motivating incentives can increase our self-control, at least up to a point.

Entrepreneurs have also become interested in self-control, as is evident from the many diet and exercise apps and gadgets on the market. To take one notable example, on the commitment contract website stickK.com, users put down some money (say, $200) and state a goal they want to achieve (such as to lose ten pounds in a month). They also need to state what will happen to the money if they don’t stick to their commitments (eg, it’ll go to a friend or to a charity they do not like). If they meet their goal, they earn their money back. If they don’t, they lose the money.

Tools like stickK.com can be effective, but they are often difficult to implement; you may need to enlist someone to help monitor your efforts. New research my colleagues and I conducted point to a different solution that may be easier to implement: using rituals.

A ritual is a series of steps we take while attaching some kind of symbolic meaning. Players in all sorts of sports have rituals that involve actions such as eating the same foods in exactly the same order before a game or listening to the same pre-ordered playlist a given number of times. From the way some prepare their coffee to the way people celebrate important life events, like weddings or graduations, rituals are a part of our daily life. And though they may seem useless, or even silly, research has found that rituals are powerful.

In the past, my colleagues and I have found that rituals reduce anxiety before stressful tasks, and improve performance. They allow us to enjoy our family holidays more. And they also give us a greater sense of control after experiencing a loss, whether a loved one or in a lottery. Given the power of rituals, we thought we might test their effectiveness in resisting temptation.

In one study, we tested the power of rituals to help with a common self-control problem: eating less. We visited a university gym and recruited undergraduate females who already had a goal of losing weight. We told half of them to be mindful about their food consumption for the next five days. We taught the other half a three-step pre-eating ritual and told them to complete it every time they ate something. The ritual, which we created rather randomly, did not require participants to eat less food and did not directly interfere with consumption. Here’s the ritual:

First, cut your food into pieces before you eat it. Second, rearrange the pieces so that they are perfectly symmetric on your plate. That is, get the right half of your plate to look exactly the same as the left half of your plate. Finally, press your eating utensil against the top of your food three times. In order to be in the study, you must do the three steps of this ritual each time you eat.

To track daily food and beverage intake, we asked participant to download the “MyFitnessPal” food-tracking app onto their phone. MyFitnessPal allows users to list exactly the type and amount of food or beverage they consume, including brands of grocery products and meals from chain restaurants. Three times per day, participants’ phones would remind them to log their food intake, and the experimenter had access to these online food diaries.

As we expected, participants who enacted the pre-eating ritual consumed fewer calories (about 1,424 calories for each day, on average) as compared to those who simply were mindful about their eating (who consumed about 1,648). Those who performed the ritual also ate less fat and less sugar. The ritual helped them exercise the self-control needed to achieve their weight loss goals. Interestingly, at the end of the study, our participants said they thought the ritual was not very helpful and reported they were unlikely to continue it.

In another study, we examined whether simple rituals could also help people make healthier choices when tempted with unhealthy ones. We invited college students to the laboratory and told them they would complete a taste test of carrots and chocolate. They received four bags from the experimenter: three that each contained one baby carrot, and a fourth that contained a Lindt chocolate truffle.

We divided participants in three groups: those engaging in a ritual, those making random gestures (all polite ones!), and those who simply ate carrots (our control condition). Those in our ritual condition were given a series of steps to perform before eating each carrot:

Make a fist with your right hand. Using your knuckles, knock on the table twice. Now, take out the first [second] [third] plastic bag and put it in front of you. Then, use your right hand and knock twice again on the table. Now, take a deep breath and close your eyes for two seconds.

Before they ate the third carrot, they answered two questions about eating the third carrot and finally learned they had a choice between eating the third carrot or a chocolate.

Those in our random-gestures condition completed a different set of steps before eating each carrot; they too were given a choice between eating the carrot (the healthy option) or the chocolate (the tempting, unhealthy one).

In the third subgroup (the control condition), participants simply ate the first two carrots, answered the same two questions, and were given the final choice without performing any additional steps.

About 58 percent of the participants in our ritual condition chose the carrot over the chocolate, as compared to only about 35 percent of those in the control condition and 46 percent of those in the random-gestures condition. Thus, participants who enacted a ritual while eating carrots subsequently made healthier choices as compared to those in the other groups. The results suggest that following a stringent set of steps, however strange, before eating may be a better weight-loss strategy than adhering to a stringent diet.

It is important to note that rituals like the ones we created and used in our research can be taken too far. When a repeated set of actions that restrict food consumption start to become mindlessly followed, as by habit, they can lead to problematic behaviors such as eating disorders, research finds. But undertaken conscientiously and carefully, such practices can also promote well-being.

Psychology research has found that our behaviors lead us to conclusions about ourselves: donating money to the homeless causes us to view ourselves as caring, and giving up our seat on the subway leads us to believe we’re polite, for instance. Following a series of steps over and over again, which happens when we use rituals, requires some good self-discipline. So, we reasoned, when we see ourselves engaging in a ritual, we code that behavior as a sign that we are people with self-control. And thanks to that self-control, we choose the apple (or carrot) over the chocolate and thus reduce our caloric intake.

Classical Confucian philosophy places a lot of emphasis on ritual. It may be no surprise, then, that evidence suggests that East Asians from highly ritualized Confucian cultures have stronger self-regulation skills than people from Western cultures. Likewise, the military lifestyle across cultures is known to induce both self-discipline and behavioral regulation, perhaps in part due to its many rituals, including marching, chanting and other regimented behaviors that ensure order and high levels of motivation. At the outset, these rituals may seem like a waste of time. Yet, as our research suggests, they are quite powerful. Even when they are not embedded in years of tradition, simple rituals can help us build personal discipline and self-control. With a simple ritual, that piece of chocolate cake may not look as tempting.