Think of something you often crave— something that, once you start thinking about it, it usually feels impossible to resist. Imagine it in detail. Picture yourself enjoying it, as vividly as you can. Do you have a specific craving in mind? Good.

The next time this craving kicks in— including right now, if you’re already feeling it!— I want you to play a simple video game like Candy Crush Saga, Bejeweled, or Tetris for three minutes. Do this, and you will be much better able to successfully resist your craving. Multiple studies published in the past year in have shown that playing these kinds of games for three minutes while feeling an intense craving cuts the intensity of the craving by at least 25 percent.  This technique worked for all kinds of cravings, including junk food, cigarettes, and even drugs and alcohol.

It may not sound like a lot, but a 25 percent reduction in craving intensity is enough to change behavior. It’s just enough of a boost to give your willpower a fighting chance.

How does it work? Research has shown that cravings have a very strong visual component. The more you mentally imagine yourself enjoying what you crave, the more likely you are to give in. To resist a craving, you simply need to give your brain’s visual-processing centers something else to visualize—and you’ll find the craving significantly reduced.  

Video games, more than any other “distracting” activity, require intensive effort from your brain’s visual processing center to keep track of the constantly changing visuals.

More On This...

Keep in mind: video games aren’t a miracle drug! If you’re hungry when you play Tetris, you’ll still be hungry afterward. But you’ll be less likely to give in to a specific, unhealthy craving, and more likely to make a smarter choice about what to eat.

You can find countless pattern-matching games for free online and on your mobile phone or tablet. The easiest ones to pick up from scratch if you’ve never played them are Tetris, Bejeweled, and Candy Crush Saga. (This last is the first video game my 67-year-old mom played in her entire life—and she taught herself how to play it in less than a minute.) If you don’t want to play a digital game, a wonderful pattern-matching card game called SET offers the same powerful flashback effects. You can find it on Amazon or at Setgame.com. Some players also report that solving jigsaw puzzles is another way to control visual attention and stave off cravings effectively.

Joe and Elisa, a Michigan-based couple I worked with to help put this technique into action, are a great example of how the right game at the right time can make you healthier. When they decided to get married, they promised each other that they would both successfully quit smoking by their wedding day. In the months before the big day, the both wore nicotine patches, which helped them fight their cravings at work. But when they came home in the evening, Joe told me, it was harder to avoid reverting back to old habits.

“There was so much going on at work, the patch was enough—we didn’t need anything else. But at home, with less going on, we were really tempted. We thought about lighting up constantly.” Thanks to the nicotine-replacement therapy, their physical cravings were in check. But they hadn’t yet gotten control over their mental cravings. They kept picturing themselves smoking and imagining how good it would feel. Those mental images were the real problem.

The gameful solution? Joe and Elisa decided to start a new tradition: puzzle nights. Every evening after dinner they sat down at the kitchen table to work on a giant jigsaw puzzle together.

“It totally worked for us,” Joe told me. “Zero cigarettes on puzzle nights.” It worked so well, in fact, that they worked on puzzles every night all the way up to their wedding. Two years later the happily married couple are still smoke-free.

Puzzle nights had one additional surprise benefit for the bride- and groom-to-be: working cooperatively on the puzzles together for so many hours, night after night, boosted their communication and problem-solving skills. “We got really good at working together and solving the puzzles as a team.” Not a bad way to prepare for marriage!

Joe and Elisa were, as it turns out, ahead of the curve with their jigsaw solution. In 2014 a team of researchers from the American Cancer Society, Brown University, and Stony Brook University found that nicotine-deprived smokers were able to reduce their cravings by playing two-player cooperative games (like the popular video games Plants vs. Zombies or Portal 2) with their relationship partners. Functional magnetic resonance imaging (fMRI) scans showed that that cooperative game play and puzzle solving lit up the same reward centers of the brain that nicotine does. The scientists believe this is evidence that social games and puzzles could provide the smokers with an alternative way to feel rewarded when they crave a cigarette the most.

In other words, game play provides a powerful one-two punch for changing behavior. First, it gives you control over your thoughts and mental cravings by fully absorbing the visual-processing center of the brain. Second, it gives you a pleasurable neurochemical reward—the same kind you would get from a cigarette, a cookie, or whatever else you might crave. Who needs a cigarette or cookie when you already feel deeply satisfied by the game?

Jane McGonigal is the author of the new book, "SUPERBETTER: A Revolutionary Approach to Getting Stronger, Happier, Braver and More Resilient – Powered by the Science of Games."