How habits form, and how to build good ones and break bad ones
A habit forms when you repeat an action in the same situation so often that the situation itself starts to trigger it, without much thought. The best-known study found this took a median of 66 days, with a range of 18 to 254 days, so the popular '21 days' figure is a myth. What helps most is tying the new action to a fixed cue, such as 'after I eat lunch, I walk for ten minutes', making it easy, and repeating it daily. Bad habits are broken more by changing cues and surroundings than by willpower alone.
Health writers · Aslam Clinic

A is an action that has been repeated so often in the same situation that the situation now triggers it automatically. You do not decide to brush your teeth after waking or to reach for tea when guests arrive; the cue sets off the action. Habits form through repetition in a stable context, and they take longer than most people are told — about two months on average, with wide variation.
That automatic quality is what makes habits powerful for health. A walk that has become a habit happens even on a tired day, when a walk that depends on motivation does not. The same automaticity is also why bad habits are so hard to shift.
How a habit works
Psychologists describe a habit as a learned link between a context and a response. The context can be a place, a time, a person, a feeling, or the action you have just finished. Each time you do the same thing in the same context and it pays off in some way, the link strengthens. Eventually the context triggers the behaviour with little thought. In one study that asked people what they were doing every hour, about 43% of daily actions were performed almost every day in the same setting.
The popular book The Power of Habit (2012) described this as a loop of cue, routine and reward. That is a useful simplification. The research points to the cue and repetition as the most important parts; the reward matters mainly while the habit is being learned.
How long does it really take?
The most cited study is by Phillippa Lally and colleagues at University College London, published in 2010. Ninety-six volunteers chose a healthy eating, drinking or exercise behaviour to do daily in the same situation — for example, "drink a glass of water after breakfast" — and rated how automatic it felt each day for 12 weeks. Among those whose results could be modelled, the time to reach near-full automaticity ranged from 18 to 254 days, with a median of 66 days. Simple actions, such as drinking a glass of water, tended to become automatic sooner than more demanding ones, such as an exercise routine.
Two points from the study matter for real life. First, missing a single day did not meaningfully set back habit formation. Second, Lally herself has stressed that 66 days is not a new magic number: the true lesson is that the time is highly variable.
Where the 21-day myth came from
The "21 days" figure is usually traced to Psycho-Cybernetics, a 1960 self-help book by the plastic surgeon Maxwell Maltz. He observed that patients took "a minimum of about 21 days" to adjust to changes such as a new face after surgery. Over time, "a minimum of about 21 days" to adjust to a change became "21 days to form a habit". It was never a research finding, and it sets people up to feel like failures when week three passes and the new habit still takes effort.
| Popular belief | What the evidence says |
|---|---|
| It takes 21 days to form a habit | The median in the best study was 66 days, with a range of 18 to 254 |
| Missing a day means starting again | A single missed day did not meaningfully affect habit formation |
| You need strong willpower | A clear cue and repetition matter more than motivation |
| Knowing why something is healthy is enough | Knowledge alone rarely changes behaviour; planning and context do |
Building a good habit
The advice that comes out of the research is simple and practical. In a 2012 paper for family doctors, Benjamin Gardner, Phillippa Lally and Jane Wardle summarised it as: decide on a goal, choose a simple action, pick a time and place, and do it every time you are in that situation.
- Choose one small, specific action. "Walk for 10 minutes" works better than "get fit".
- Attach it to a fixed cue that already happens every day — after a meal, after a particular prayer, after brushing your teeth, when you get home from work.
- Make an if–then plan. "If it is after lunch, then I walk to the end of the street and back." These plans are called implementation intentions.
- Make it easy. Put walking shoes by the door; keep the pill box next to the kettle; fill the water bottle the night before.
- Repeat daily, in the same context. Consistency of cue matters more than intensity.
- Track it for the first couple of months — a tick on a calendar is enough. Expect it to feel like effort for weeks before it feels automatic.
Implementation intentions have strong evidence behind them. A 2006 meta-analysis by Peter Gollwitzer and Paschal Sheeran, combining 94 tests with more than 8,000 people, found that forming if–then plans had a medium-to-large effect on reaching goals, including health goals. Lally puts it simply: a clear plan of when and where you will do something makes you more likely to do it than a vague intention.
Breaking a bad habit
Because old habits are triggered by cues, trying to resist them by willpower alone is exhausting and often fails, especially when you are tired, stressed or hungry. The research suggests working on the environment instead:
- Remove or avoid the cue. If you smoke with tea after dinner, change where you sit after dinner, or change the drink.
- Add friction. Keep biscuits out of sight or not in the house; log out of apps; leave cigarettes in the car rather than your pocket.
- Plan a replacement. An if–then plan for the moment of temptation — "If I feel like a cigarette after a meal, I will chew saunf and walk to the gate" — works better than simply saying no.
- Use natural fresh starts. Moving house, a new job, or a change of routine loosens old cues. Ramadan changes the whole daily pattern, which is why many people use it as an opportunity to stop smoking or cut down on tea and sweets.
- Expect slips. Old habit memories are not erased; they can come back when the old cue returns. A lapse is information, not failure.
Putting it to work for your health
Some of the most useful health habits are small actions attached to things you already do every day.
| Goal | Cue to attach it to | Tiny starting version |
|---|---|---|
| Better blood sugar | Finishing lunch or dinner | Walk for 10 minutes — around the courtyard, on the roof or to the corner shop |
| Taking daily tablets | Morning tea, or after Fajr | Keep a weekly pill box next to the teapot |
| Checking blood pressure | First Sunday of the month | Write the reading in the same notebook |
| Drinking more water | Each prayer time | One glass of water after wudu |
| Better sleep | Isha | Phone on charge outside the bedroom after Isha |
Walking after meals is worth singling out for anyone with or at risk of it. A 2023 review of randomised trials found that exercise after eating reduced the rise in blood glucose more than exercise before eating. Pairing it with a meal gives you a cue that happens every day. Pairing tablets with an existing routine does the same for and diabetes medicines, which are often missed not from choice but from forgetting.
What you can do today
Common questions
Still not sure what to do?
Reading about a symptom only goes so far. A doctor who can ask you questions and examine you will get further in ten minutes than any article can.







