My cat Mira likes to do the same things at the same time, every day. At some point I put my hand under the bathroom door while brushing my teeth, which she took at an invitation to play “try to catch the fingers while adorably rolling around on the floor.”

Now every time I brush my teeth, Mira stares at me beside the end of the open door waiting for me to start the game. She established a loop: me brushing my teeth means she gets to play her favorite game. Living with a cat is all about these sorts of loops—things that happen at a given time one day are expected to happen at the same time the next. Anyone who has tried to feed a cat later than usual knows this extremely well, but it’s more than that. Mira likes to establish habits.

Now, you probably think you’re more intelligent than a cat, and in some ways you probably are. But I’m pretty sure you live in loops, just like a cat—there are things you do every day, like clockwork. Some of those habits you’re probably happy with; others, not so much. To change them, though, you’re going to need to spot them and change the context that triggers them. I’ve recently been thinking about my daily habits as being pretty similar to Mira’s loops. I am, when it comes to my habits, not that different from my cat. I will do the same things at the same time every day, and pick up new little routines as time goes on. But that doesn’t mean I have to keep them all.

How loops form

So where do these “loops” come from? Researchers from University College London summed it up like this: “As behaviors are repeated in consistent settings, they then begin to proceed more efficiently, and with less thought, as control of the behavior transfers to cues in the environment that activate an automatic response: a habit.”

In other words, doing the same thing every day in the same environment can eventually make an action automatic. You probably don’t have to remind yourself to brush your teeth—you habitually do it every time before you go to sleep (in my case, while playing with an energetic cat).

Researchers from Duke also note the importance of context to habit formation: “When responses and features of context occur in contiguity, the potential exists for associations to form between them, such that contexts come to cue responses.” My cat Mira has started to associate a specific context (me, in the bathroom, brushing my teeth) with a specific activity (waiting for my fingers to show up). We’ve formed a habit together. Of course, there are some habits I wish she didn’t have—eating house plants comes to mind. Luckily, there’s plenty of research out there to help us change those ones into something more manageable.

The best way to change habits

Those aforementioned researchers from Duke found that relying on self regulation to change a habit doesn’t work particularly well, especially during stressful times in your life. What does work, according to the essay, is changing your context. For example, if you want to break a habit that re-occurs every day, consider relocating during the time of the day the habit usually triggers. If you tend to crack open a beer every day at 5:30 p.m. and wish that you didn’t do that, try to stay away from your fridge. Better yet: don’t put any beers in your fridge in the first place.

For a while, Mira had a morning habit of chewing up one of our plants, every morning, before we got out of bed. This happened until we interrupted the habit using cat deterrent, a can of compressed air that harmlessly goes off when she tried to approach the plants in question. For a few days, we heard her trying to eat the plants but running away after the air can went off. Eventually she stopped trying to eat the plants, even when the cat deterrent wasn’t there. We changed the context and disrupted the habit. We broke the loop.

I’ve recently been thinking about my daily habits as being pretty similar to Mira’s loops. I will do the same things at the same time every day, and pick up new little routines as time goes on. But that doesn’t mean I have to keep them all. I changed Mira’s plant-eating loop by placing a deterrent. It took a few days, but eventually the loop broke and Mira stopped trying to eat my plant. I can do the same thing for myself. This could mean setting up applications to block distractions, or it could mean unfollowing the most addictive subreddits so that the website is less habit forming. I need to change the context.

I could list specific examples all day, but the basic point is this: if you want to change your habits, you can’t rely on willpower alone. You need to change the context that triggers those habits, and in the process, form some new (and hopefully more helpful) ones.