Sometimes it’s the little things that get you. My little thing was diet soda. It was a small, daily habit, but as Annie Dillard said, “How you spend your days is how you spend your life.” And following that logic, I was spending my life swimming in chemical soup.

Portrait of the Diet Cola Fiend: The Early Years

Here’s an easy test to determine whether you’re addicted to a substance: Do you have specific criteria for your preferred “high?” If so, you might have a problem.

I had a brand of choice, and I always wanted to drink from a can for maximum coldness. Never with a straw, I wanted to plant my lips on the can like an extended kiss. And I lived for that kkk-shhhew sound of the can popping open. (Years after kicking the habit, hearing that sound will kick off a reaction. Dr. Pavlov, you knew your stuff.)

My love went deep. Diet soda was wonderful! Every can was a mini celebration. The jubilant bubbles! The hit o’ sweet! That pick-me-up perk of caffeine. A can alone was enough to turn a crummy moment around.

And when I didn’t have soda… well, I was no fun at all. Headaches from the lack of caffeine and sluggishness were my standard physical symptoms of withdrawal. But worse was that dull, gray feeling like my day had flatlined into a treat-free zone with no pick-me-ups on the horizon. So very sad.

What started as an occasional trip to the vending machine became a four-to-five-can-a-day habit at my first post-college job. The work, answering phones and doing filing, was dead boring, but I had a vending machine just steps away from my desk. And it had my cola of choice. Dangerfood, enter stage left. I had one with every meal—including breakfast—and one or two with snacks. It got to the point that I’d filled an entire filing cabinet with cans. Taking them home to recycle was my soda walk of shame: these discarded silver husks clattering around in an oversized bag were a reminder that I was out of control.

99 Reasons to Quit, but Flavor Wasn’t One

I justified my addiction in many ways; my primary rationale being that diet soda seemed so innocent. I didn’t do drugs or smoke, and I hardly ever drank alcohol. Soda was my one and only vice, and didn’t everyone deserve to have one of those?

As far as bad habits went, my diet soda dependency certainly didn’t make me special. Around, oh, 63 million Americans drink diet soda on any given day. And I can tell you, no one ever wrote a compelling character for a prime-time drama with the description, “Hard living and years of diet soda had colored her past.” Basically the monkey on my back was neither interesting nor cool. (Picture Don Draper hitting a supersized fountain soda instead of his bourbon. Bye-bye sex appeal.)

Plus, there were plenty of compelling reasons to quit. Artificial sweeteners have been linked to many serious diseases: metabolic syndrome, type 2 diabetes, hypertension, cardiovascular disease. The caramel coloring has even been linked to cancer. What if I let vanity be my guide and decide a little chemo was worth a little waist? Bad news, cola lovers, studies show diet soda actually adds several notches to your belt loop. And new research proves diet cola can prompt you to go gaga on sweets, negating those “no calorie” claims.

So I finally decided to quit. And failed. And failed two more times. And then failed again. Finally, on my fifth go, I cracked the code on my addiction. And that’s where I am now, living free from the cola cuffs that once bound me.

If you’re struggling with quitting this saccharine brown stuff, learn from my attempts, both the repeated failures, and my final triumph.

My 4 Failed Attempts, in Brief

Attempt No. 1: Moderation
"Moderation" is a nice word, right? It’s warm and inclusive, where “quit” is so harsh. For me, the trouble with moderation is that the boundaries are so fuzzy. What does it look like? What are the rules? When I’m guzzling down four to five cans a day, is moderation one can? Or three? And which cans do I sacrifice? Surely not breakfast—it’s the most important meal of the day! And not lunch. I need my lunchtime boost! And not my snack time. (You can see why this didn’t work.)

Attempt No. 2: Cold Turkey
OK, moderation was a bust, so I needed to get tough. And the tough go cold turkey. Tap water became my new diet soda. The only hitch was that I hate tap water. Every sip felt like a punishment. And was I really going to have an afternoon cookie with a glass of tap water? That just seemed so, so sad. Where was the celebratory sparkle? The fun? The party in a can?

Cold turkey didn’t last.

Attempt No. 3: Change of Environment
By now, I’d figured out my environment had a lot to do with my addiction. I needed a diet soda rehab center away from my corner store and my vending machine. And I had the perfect moment to bust out of my routine: I was going to remote Alaska for two weeks. There, I could measure the distance between me and diet soda in nautical miles. I could go through my caffeine withdrawal in my little cabin far away from diet soda’s siren song of sweet relief. Sure enough, after a week, I was off the stuff. Here’s the problem: I hadn’t laid any groundwork that would help me navigate the difficulties of my soda abstinence once I was back in my day-to-day life. I assumed I’d breeze by any shelves and coolers of diet soda I came across. But as soon as I had my first stressful day at work, I was back in the warm glow of the vending machine.

Attempt No. 4: Back to Cold Turkey
Obviously the problem was my lack of willpower. But I really wanted to change! I would redouble my efforts. I would avoid… oh who am I kidding? It didn’t work the first time, and it didn’t work this time either.

Seeing the Light: My 5th and Final Attempt

What was different this time? I turned to science. I started studying the pattern of habits. Habits are largely unconscious, which is why they’re so hard to break. Your brain is so used to treading the same path that it’s hard to forge new ones. That goes double for something that’s a daily habit, which has worn deep grooves into your brain’s carpet. The trouble with stopping that behavior is you’ve already conditioned your unconscious mind, which is almost impossible to undo.

I read Charles Dunhigg’s book The Power of Habit, and I started to understand something he calls “the habit loop.” In the book, Dunhigg breaks down the unconscious cycle of habit into three steps: cue, routine, and reward. Subtle cues we read during the day will trigger our behavior and that in turn will give us a reward. The reward cements the behavior loop. That means once we see the cue, our brain has already hit fast-forward, and it’s reaching for that treat. Often you’re not even aware of these cues, you just find yourself surrounded by empty husks of diet soda all over your desk (to use an entirely random example).

The bad news is once the habit loop is in place, it’s incredibly difficult to dismantle. But there’s hope. You can hack the habit loop. The key is to keep the same behavior and reward, but change the routine.

Hacking the Habit Loop

Dunhigg uses the example of Alcoholics Anonymous. Here’s what an alcoholic’s habit loop looks like according to Dunhigg:

Cue: Tough day at the office.
Routine: Hit the bar HARD. Shots! Sing-a-longs! The bartender so gets me.
Reward: Feeling good, supported, and stress-free.

Alcoholic Habit Loop

Now the alcoholic joins AA:

Cue: Tough day at the office.
Routine: Hit AA. Stories! Donuts! My sponsor so gets me.
Reward: Feeling good, supported, and stress-free.

Now my habit isn’t as damaging as alcoholism, but it’s easy to apply the same principles. Here’s my typical diet soda run:

Cue: Tough day at work, I look up from my inbox to see it’s 4 p.m., diet soda o’clock. Time for a treat!
Routine: Walk away from my desk to the vending machine. Crack open a cold can.
Reward: Ahh! Sweet, sweet soda. Pleasure centers in the brain light up like the Rockefeller Center Christmas tree.

My mission was to keep the same habit, but replace the outcome. Afternoon “treat time” could not be undone. But it could be another routine.

My problem: the reward needed to be the same. That’s when I took a hard look at diet soda itself.

Breaking Down the Formula: Bubbles and Sugar and Caffeine, Oh My!

What could give me that same kick in the prefrontal cortex? I examined the formula and tried to replace those components. In diet soda, I get three things: bubbles, a sweet treat, and caffeine. Finding all three in a natural beverage was tricky. But I could find a substitute for each. Seltzer could give me my festive bubbles, iced tea or coffee my caffeine, and milky-sugary additions to that would be my sweet treat.

Real talk: That last one wasn’t exactly healthy. When I first started hacking my habit loop, I was basically swapping diet soda for cake-in-a-cup: I drank coffee or tea with a giant splash of milk and heaps of sugar. But, it was all natural, and that was my starting point. Step by step, I pulled back on the sugar, swapped in almond milk, and my treat became a bit more healthy.

This took time. My brain was wired for a big wallop of sweet, and yanking that away wouldn’t give me the reward I expected. The game plan was to shift my palate slowly so I’d still “read” the beverage as my treat and my brain would be fully fooled.

Meet My New Habit Loop

My reward in place, I subbed in my new routine into my habit loop. It unfolded like this:

Diet Soda Habit Loop

Cue: Tough day at work, I look up from my inbox to see it’s 4 p.m., iced tea o’clock. Time for a treat!
Routine: Walk away from my desk to the coffee shop. Grab an iced tea with a splash of almond milk and some Stevia.
Reward: Ahh! Sweet, sweet iced tea. Pleasure centers in the brain light up like the Rockefeller Center Christmas tree.

Success!

Yes, my fellow diet soda fiends, the system works. Miraculously my brain picked up this new flight pattern knowing the reward would be waiting, and I managed to dupe myself into my new MacGruber-ed faux diet soda. The happy ending is that years later I can confidently say I’m in diet soda remission. I can walk past the vending machine with my head held high.

To all the other diet soda fiends out there I can say, it gets better.

READ THIS NEXT: How to Become a Morning Person