If-Then Planning: How to Make Good Habits Stick

In his book Homo Deus, historian Yuval Noah Harari writes1:

‘Algorithm’ is arguably the single most important concept in our world. If we want to understand our life and our future, we should make every effort to understand what an algorithm is, and how algorithms are connected with emotions.

So, what is an algorithm? The dictionary defines it as “a process or set of rules to be followed in calculations or other problem-solving operations, especially by a computer.”

If you’ve ever wondered how a Tesla can drive itself, the answer is algorithms—millions of them. But there are also more relatable everyday occurrences of algorithms. Each time you bake a cake, for example, the recipe you use is an algorithm.

Habit Algorithms

Interestingly, psychologists have found that you can also use algorithms to master your habits. Psychology professor Peter Gollwitzer refers to this strategy as if-then planning2. To use it, all you have to do is fill out this formula:

If [situation] – Then I will [habit].

The beauty of if-then planning is that it forces you to turn vague intentions into specific actions.

“I want to eat healthier,” becomes “If I’m buying lunch, then I will order a salad.”

It’s a simple yet powerful strategy. Over 200 scientific studies show that if-then planners are about 300 percent more likely to achieve their goals.

The Power of If-Then Planning

The reason if-then planning so exceptionally well, according to psychologist Heidi Grant, is that3:

Contingencies are built into our neurological wiring. Humans are very good at encoding information in ‘If X, then Y’ terms, and using those connections (often unconsciously) to guide their behavior.

In other words: much like computers, our minds respond very well to algorithms.

If-then plans allow you to act the way you want without thinking, and that saves a lot of mental energy.

Instead of hesitating and deliberating, you just execute the algorithm whenever the situation arises.

Create Your Own If-Then Plans

Rather than relying on vague intentions, purposely install the specific responses that will lead you to your goals. Let’s have a look at some examples:

  • “I want to move more.” → If I’m at work, then I will take the stairs.
  • “I want to sleep better.” → If it’s after noon, then I will have water instead of coffee.
  • “I want to be more productive.” → If I arrive at the office, then I will do two hours of deep work.
  • “I want to improve my relationships.” → If I come home from work, then I will share the best thing that happened to me that day.
  • “I want to be happier” → If I wake up in the morning, then I will think about one thing I’m grateful for.

Think of yourself as a robot and the if-then plans as the algorithms you use to program yourself. It sounds silly, I know, but it’s a remarkably effective way to make good habits stick.

Do you want to master your habits? Get my book The Habit Blueprint.


  1. Homo Deus: A History of Tomorrow by Yuval Noah Harari, page 83
  2. Implementation Intentions and Effective Goal Pursuit
  3. Get Your Team to Do What It Says It’s Going to Do

Improve Your Life in 5 Minutes a Week

Get my free One Percent Better newsletter.

It’s short, actionable, and loved by 7,000+ subscribers.

Enter your email address below now and join us:

I’ll never share your information, and you can unsubscribe easily anytime.