Every day, we are tested. Whether it’s a cookie tempting us from our diets or a warm bed coaxing us to sleep late, we are forced to decide between what we want to do and what we ought to do.

The ability to resist our impulses is commonly described as self-control or willpower. The elusive forces behind a person’s willpower have been the subject of increasing scrutiny by the scientific community trying to understand why some people overeat or abuse drugs and alcohol. What researchers are finding is that willpower is essentially a mental muscle, and certain physical and mental forces can weaken or strengthen our self-control.

Studies now show that self-control is a limited resource that may be strengthened by the foods we eat. Laughter and conjuring up powerful memories may also help boost a person’s self-control. And, some research suggests, we can improve self-control through practice, testing ourselves on small tasks in order to strengthen our willpower for bigger challenges.

“Learning self-control produces a wide range of positive outcomes,’’ said Roy Baumeister, a psychology professor at Florida State University who wrote about the issue in this month’s Current Directions in Psychological Science. “Kids do better in school, people do better at work. Look at just about any major category of problem that people are suffering from and odds are pretty good that self-control is implicated in some way.’’

Last month, Dr. Baumeister reported on laboratory studies that showed a relationship between self-control and blood glucose levels. In one study, participants watched a video, but some were asked to suppress smiles and other facial reactions. After the film, blood glucose levels had dropped among those who had exerted self-control to stifle their reactions, but stayed the same among the film watchers who were free to react, according to the report in Personality and Social Psychology Review.

The video watchers were later given a concentration test in which they were asked to identify the color in which words were displayed. The word “red,” for instance, might appear in blue ink. The video watchers who had stifled their responses did the worst on the test, suggesting that their self-control had already been depleted by the film challenge.

But the researchers also found that restoring glucose levels appears to replenish self-control. Study subjects who drank sugar-sweetened lemonade, which raises glucose levels quickly, performed better on self-control tests than those who drank artificially-sweetened beverages, which have no effect on glucose.

The findings make sense because it’s long been known that glucose fuels many brain functions. Having a bite to eat appears to help boost a person’s willpower, and may explain why smokers trying to quit or students trying to focus on studying often turn to food to sustain themselves.

Consuming sugary drinks or snacks isn’t practical advice for a dieter struggling with willpower. However, the research does help explain why dieters who eat several small meals a day appear to do better at sticking to a diet than dieters who skip meals. “You need the energy from food to have the willpower to exert self-control in order to succeed on your diet,” said Dr. Baumeister.

Kathleen Vohs, professor of marketing at the University of Minnesota, says that in lab studies, self-control is boosted when people conjure up powerful memories of the things they value in life. Laughter and positive thoughts also help people perform better on self-control tasks. Dr. Vohs notes that self-control problems occur because people are caught up “in the moment’’ and are distracted from their long-term goals.

“You want to look good in a bikini next summer but you’re looking at a piece of chocolate cake now,’’ said Dr. Vohs. “When we get people to think about values we move them to the long-term state, and that cools off the tempting stimuli.’’

Finally, some research suggests that people struggling with self-control should start small. A few studies show that people who were instructed for two weeks to make small changes like improving their posture or brushing their teeth with their opposite hand improved their scores on laboratory tests of self-control. The data aren’t conclusive, but they do suggest that the quest for self-improvement should start small. A vow to stop swearing, to make the bed every day or to give up just one food may be a way to strengthen your self-control, giving you more willpower reserves for bigger challenges later.

“Learning to bring your behavior under control even with arbitrary rules does build character in that it makes you better able to achieve the things you want to achieve later on,” said Dr. Baumeister. “Self-control is a limited resource. People make all these different New Year’s resolutions, but they are all pulling off from the same pool of your willpower. It’s better to make one resolution and stick to it than make five.”