In this article, you will learn about the anatomy of behavior and how you can change your life.

In this article, you will learn about the anatomy of behaviour and how you can change your life.

I have a shameful secret. Most of my readers do not know about it – in fact, no one I have met this year knows about it. But I am willing to confess it to you right now:

I used to have a cocaine problem.

Yes, I knew the health risks when I started; to be honest, that was half the fun. The first time I tried cocaine was when I was travelling through Columbia. Somebody offered it to me for free, and being the young, stupid, manic, wild man that I was – I said yes, and surprise, surprise – I fucking loved it.

In my mid-twenties, I was a notorious party animal who never said no to anything, including inhuman amounts of alcohol. When I discovered cocaine, I felt invincible because now I could drink as much as I wanted without turning into a drunken idiot who could not talk anymore.

There was only one “tiny” downside to this habit, whenever my drug-induced mania ended (I usually stayed awake for 2-3 days straight), I found myself in a state of absolute depression.

No, I do not mean hungover, I mean hating my guts to the degree where I made actual plans of finding a high bridge and doing a backflip off it.

After a couple of years of this self-mutilating dance routine, I made up my mind to stop being the architect of my own misfortune.

So, I set a goal to quit. Again… and again… and again.

Picture by Shimon Oskteyn

Each time it would last for a few weeks. But all my sobriety attempts failed, and I had to admit something to myself that changed my life forever: My mind cannot solve a problem that my mind produced.

I have felt that either I end this bad habit, or this bad habit is going to end me.

One of the first steps I made was to go to Amazon and order every fucking book that I could get my hands on, which could help me to save my soul. One of the first building blocks of that autodidactic journey was to order Charles Duhigg’s “The Power of Habit“.

Reading this book moved me away from the disempowering belief of “being broken”, and towards the belief of “having broken habits”. That is a big fucking difference.

The following article is going to attempt to give you a similar “aha” moment, where you divorce your self-worth from your current bad habits.

In my coaching practice, I often use a metaphor where I compare the brain to an iPhone.

Some people use their smartphone to play CandyCrush and procrastinate meaninglessly on social media or binge-watch Russian fail videos on YouTube, and other’s use their smartphone to listen to the greatest minds in the world via podcasts, teach themselves new languages with Duolingo, and biohack their way towards success with fitness apps.

Now, imagine your habits as apps. Your bad habits are apps that move you away from who you want to be, while your good apps are habits that make you happier, smarter, and stronger. Good habits turn you into who you want to become.

If you were to find a phone on the street that had bad apps on it, would you throw the phone away? Obviously not, you would find a way to align the software with your needs and use the smartphone in a manner that serves you.

Understanding that I accidentally installed some disempowering apps onto my brain-computer helped me to move away from guilt, shame, and self-pity, and towards self-efficacy, self-love, and freedom of mind.

The following article will introduce you to Charles Duhigg’s famous Habit Loop Model; this model is, from my point of view, the best starting point to understanding the science of habit formation.

The Habit Loop

The human brain is somewhat similar to an onion, in that it is composed of layers of cells. Most “human” thinking happens at the outermost layers of the onion. Without that layer, you would not understand this article. (If you cannot understand this article, it could be that my outer layer is not intact anymore).

On the evolutionary timescale, the layer that you use for complex thinking is the “youngest”, and if you go deeper into the brain, you will find a golf ball-sized bit of tissue called the basal ganglia. Its job is it to store your automatic patterns – your habits.

Since the basal ganglia is a super old primitive structure, it can also be found in the brain of a rat. To study the functions of the basal ganglia, scientists from MIT did an experiment with rats. The researchers opened the skull of the rats and put probes inside the brain to measure the activity of the basal ganglia. They then put them in a T-shaped maze with chocolate at the end of it. When the rat went looking for the chocolate, the researchers measured the brain activity of the rats.

The maze was structured so that each rat was positioned behind a partition that opened when a loud click sounded. Initially, when a rat heard the click and saw the partition disappear, it would usually wander up and down the center aisle, sniffing in corners and scratching at walls. It appeared to smell the chocolate, but couldn’t figure out how to find it. When it reached the top of the T, it often turned to the right, away from the chocolate, and then wandered left, sometimes pausing for no obvious reason. Eventually, most animals discovered the reward. But there was no discernible pattern in their meanderings. It seemed as if each rat was taking a leisurely, unthinking stroll. The probes in the rats’ heads, however, told a different story. While each animal wandered through the maze, its brain — and in particular, its basal ganglia — worked furiously. Each time a rat sniffed the air or scratched a wall, its brain exploded with activity, as if analyzing each new scent, sight, and sound. The rat was processing information the entire time it meandered. — The Power Of Habit1

The scientists repeated this experiment several times and measured the brain activity of the rats. For the first few trials, the rat had an awful lot of activity in its brain, and this is reflected in the left image below. Now – check out the other image on the right side; there is at first, a lot of brain activity when the click happens – then there is nothing. There is activity again because the rat finds the chocolate. In between those two spikes in the right image is a gap because this is where the basal ganglia takes over, and the rat acts automatically to get through the maze to the chocolate. It operates out of habit. The purpose of habit formation is to save energy; when you go to the toilet, and you finish your business there, you do not have to think about wiping your behind, this happens out of habit, or to be more precise, your basal ganglia runs you through the motions so that you can think about other more important stuff.

By running through the maze over and over again, the rat created a habit, or as Duhigg would say – the rat formed a habit loop.

Each habit has three parts, according to this study.

A Cue (Reminder) that initiates the habit, for the rat, the cue was the click sound. The cue turns on the basal ganglia and lets the rat begin the automatic routine subconsciously. The second ingredient is the Routine, for the rat, this would be the habit of searching for the chocolate. The third and final step of habit formation is getting the Reward, which for the rats is to find and eat the delicious chocolate.

This process within our brains is a three-step loop. First, there is a cue, a trigger that tells your brain to go into automatic mode and which habit to use. Then there is the routine, which can be physical or mental or emotional. Finally, there is a reward, which helps your brain figure out if this particular loop is worth remembering for the future: Over time, this loop— cue, routine, reward; cue, routine, reward— becomes more and more automatic. — Charles Duhigg

Pavlovian Association

Wolfram Schultz, a Professor of neuroscience, identified a fourth variable of the habit loop – cravings2.

He discovered this ingredient by experimenting with a monkey named Julio. He positioned Julio, the monkey, in front of a monitor. Julio’s job was to touch a lever whenever a specific shaped/coloured object appeared on the monitor. If Julio touched the lever when the correct shape appeared, he would be rewarded with a drop of delicious juice. After repeating this experiment a couple of times, Julio developed a juice habit.

During the experiment, Schultz measured Julio’s brain activity and discovered something interesting. Take a look at the left image below. During the first few rounds of this experiment, Julio’s brain activity spiked when he was rewarded with the delicious juice. As the experiment continues, Julio has increased brain activity BEFORE he is given the reward. Psychologists call this pavlovian effect association; we call it craving.

To sum this up, a habit loop consists of the following four components:

The Cue

The cue is the stimulus that triggers the behaviour. It could be an external stimulus, such as something you see, hear, or smell. It could also be an internal stimulus, such as a drop in blood sugar, an emotion, or a thought.

The Routine

This is the habitual behaviour or routine that we execute in response to the cue. It could be reaching out for a piece of chocolate in response to a drop in our blood sugar, reaching out for a drink in response to a higher stress level at the end of the day, or going to the gym first thing every morning.

The Reward

Ultimately, this is the reason for performing the habitual routine. It could be the good feeling that a rise in blood sugar brings about or the “high” that results from an intense workout at the gym.

The Craving

This is the Reward Anticipation Signal generated by our brain in response to the cue, and in anticipation of the expected reward. In fact, our brain memorises the satisfying sensation or feeling that results from the reward. We desire to experience this pleasurable sensation or feeling that motivates us to execute the behaviour in response to the cue.

This is how new habits are created: by putting together a cue, a routine, and a reward, and then cultivating a craving that drives the loop. Take, for instance, smoking. When a smoker sees a cue— say, a pack of Marlboros— her brain starts anticipating a hit of nicotine. Just the sight of cigarettes is enough for the brain to crave a nicotine rush. If it doesn’t arrive, the craving grows until the smoker reaches, unthinkingly, for a Marlboro. Or take email. When a computer chime or a smartphone vibrates with a new message, the brain starts anticipating the momentary distraction that opening an email provides. That expectation, if unsatisfied, can build until a meeting is filled with antsy executives checking their buzzing BlackBerrys under the table, even if they know it’s probably only their latest fantasy football results. — Charles Duhigg

Habit Loop Example

My Old Cocaine Habit Loop

Remember the beginning of this article where I confessed that I had a cocaine problem? This is going to be our habit loop example for today…

Behavioural Analysis:

My cue for my alcohol/cocaine habit was pain based; I was living an unhappy life deprived of real connection, love, a meaningful career, and friends who wanted the best for the best part of me. When I developed my cocaine and alcohol routine, it was as if I had discovered a pause button for my life, and for the pain that ensued out of it. My reward for my cocaine/alcohol habit was that for a brief time, I found myself surrounded by people again. Obviously, it was the wrong kind of people, but I was somewhat in a bad group that was better than no group at all. The craving behind my drug habit loop was multidimensional. For once, I was craving happiness since my everyday life was not rich in positive emotion, so learning that I could cheat my way to temporary pleasure was addicting by itself to me. Doing drugs was also a short relief for my depressed symptoms of melancholia, loneliness, and self-hate. So, when I did drugs, I was again able to communicate with people excessively and present to them the fake image of a person who is high on life rather than high on drugs.

The Golden Rule Of Habit Formation

My road to sobriety was an adventure in itself, which deserves its own book. However, I would like to share with you right now a simple method that helped me to control my brain when it asks me to engage in acts of self-mutilation and self-betrayal.

Once I learned the anatomy of behaviour, I was empowered to translate my brains craving into what they really were – reminders that I was disconnected from the things that make life liveable, such as a meaningful career, a romantic relationship that is embedded in the truth, friends who want the best for the best part of me, growth, community, and adventures.

This discovery allowed me to identify the underlying craving behind my bad cocaine habit, and it enabled me to swap it for another habit that satisfied the same need without damaging my biology and spirit.

To defeat my bad habit, I had to ask myself one straight forward question:

What behaviours can I learn that will satisfy my need for connection without corrupting my character?

Since I was not really in love with cocaine, but with connections, I could implement new habits that would give me the feeling of being connected without having to sacrifice my mental and physical health.

While priorly, I was using drugs to satisfy my need for connections, now, I installed counter habits which were giving me similar positive experience, such as:

  • Meeting friends when I need relief.
  • Playing basketball when I need to shut off my brain.
  • Have road trips with my friends to exotic places when I was craving adventure.
  • Interview strangers on the streets and chat with them about life.
  • Use Tinder to meet girls instead of flirting at parties.
  • Chat with people from my co-working space.

 My Upgraded “Cocaine” Habit Loop

One of the simplest ways to swap your bad habits is to identify the ingredients of your habit loop and switch your disempowering behaviours for better behaviours.

Easy, right? Congratulations, you have just learned Charles Duhigg’s Golden Rule Of Habit Change, which can be summarised into one axiomatic behavioural rule:

“Keep the cue, provide the same reward, insert a new routine.” – Charles Duhigg

The Anti Craving Technique

One of the exercises that have helped me to swap all sorts of disempowering habits for empowering habits was an exercise that I call the Anti Craving Technique.

I used this psychological exercise a lot when I was in danger of breaking my sobriety. Although I am much more equipped to handle my addictive urges, to this day, I still have drug cravings. I will probably have them for the rest of my life.

The exercise is simple: when your brain is craving a bad habit, deconstruct the neurological call, and find a better habit that will also give you what you need.

Below, you will find an example of three disempowering cravings that I successfully managed recently. Read through those examples, and create your own table in your journal.


Craving 1 Craving 2 Craving 3
Cocaine craving Eating McDonald’s Oversleeping
What do I really crave? Company…Fun…Recognition…Adventure… A lot of food. A break from the world…
How do I feel about this? It’s challenging; I feel I would love to kick it with my boys tonight. Stupid, I ate enough today. Not good, my life is fine, my brain is lying again.
Do I need this? I need company, but I don’t need to hurt myself this weekend. I have things to do that demand my full powers. No. Fuck no.
What if I wait? It won’t go away; I need a connection. I will feel awesome. It will get worst.
Is there a different behaviour that would give me the same reward? If so, then what? Yes, my friend Pawel asked me to do a hiking trip with him tomorrow. I could join him and have my own sober adventure. I can make myself an awesome salmon salad at home. Meditation for twenty minutes.
What was my cue? I overworked, now I crave connection. Seeing a McDonald’s sign on my way home. Getting a reminder from my co-working office that the rent is due.

Do You Want To Change Your Habits? 


  1. Duhigg, C. (2014). THE POWER OF HABIT. New York, NY: Random House.
  2. Schultz W. Predictive reward signal of dopamine neurons. J Neurophysiol. 1998 Jul;80(1):1-27. DOI: 10.1152/jn.1998.80.1.1. PMID: 9658025.

Psychology exercises for you

Next Article

How Long Does It Take To Change Your Habits?

Previous Article

The 1% Habit - The Surprising Power Of Incremental Improvements

Related Articles

You might find these articles also interesting
  • 14th September 2023

The Count of Monte Cristo’s Wisdom: Your Guide to Life’s Storms

  • 15th December 2022

How To Unlock Your Hidden Potential With Logotherapy

  • 24th December 2022

How do we regain hope after we lost all faith in the future? – A Therapy Tool From Holocaust Survivor Viktor Frankl

Leave a Reply

Your email address will not be published. Required fields are marked *

FREE Habit Builder

Get my guide to tap into the power of habit formation for free.

Daniel Karim
Follow Me

© Daniel Karim