As a health journalist, I often write about the latest scientific research on the benefits of exercise and healthy eating. A lot of times, this seems like common sense: exercise regularly, eat more fruits and vegetables.

But one important piece is often missing from my stories: How do you turn these healthy actions into healthy habits?

This is the hard part.

Let’s face it, we’re not always good at sticking with our health goals. Sure, we may walk every day or snack on peppers instead of cookies for a couple of weeks.

But then life happens — our motivation sags, our schedule shifts, we get sick, someone in our family gets sick, Netflix adds a new favorite show.

The good news is that there is a better way to build habits.

An easier way.

A more effective way.

It looks like this (don’t worry, there won’t be any algebra quizzes afterwards):

ACTION + CONTEXT = HABIT

Research shows that the most effective way to turn a healthy behavior into a healthy habit is to repeat a simple action consistently in the same context until it becomes automatic and effortless.

This is a lot easier than it sounds.

You probably already do it many times during the day, such as washing your hands after using the washroom or putting on your seatbelt after getting in the car.

You probably started developing these habits when you were young — a parent told you repeatedly that after you use the washroom (context), you should wash your hands (action).

Fast forward to adulthood … and those two things are now deeply connected (habit).

It works the same way with starting a new exercise program, eating healthier, doing yoga regularly, or other healthy changes.

Here’s how turn healthy actions into healthy habits:

  • Choose a simple action that you would like to turn into a habit. Small actions (e.g. focusing on your breath for one minute after waking up) are easier to turn into habits than more elaborate ones (e.g. meditating for an hour every night after dinner).
  • Choose an appropriate context in which to do the action. This should be something that happens regularly during your week, such as after waking up, after breakfast, or when you get to work.
  • Put the action and the context together. Every time you encounter that context, do the action. Rinse and repeat.

Once you have a habit in place, you can build on it. This might mean starting with five minutes of yoga every morning after you wake up. After 10 weeks of that, increase it to seven minutes a day.

In the beginning, you will need to put a lot more effort into remembering to do the action consistently. But as the action grows into a habit, it will become much easier, and eventually automatic.

So how long will this take?

One study found that it took people on average 66 days to build a new habit. However, the results ranged from 18 to 254 days.

Why not give it a try? It’s always a good time to work on developing healthy habits.