Along the Pacific Crest Trail, hikers who set out to complete the entire 2,650 miles from Mexico to Canada are especially vulnerable to quitting at two points: around mile 100 and mile 1,000.

Those who make it past mile 100 are the hikers who carve out new habits amid the challenge of their new lives: wake up, eat Pop-Tart, stuff tent into pack, walk. Wearing clothes clammy with yesterday’s sweat, squatting behind a tree to go to the bathroom, and eating ramen for dinner every night become the norm.

But hikers who establish those useful on-trail habits tend to get bored of them as soon as the novelty and challenge are gone. This disenchantment often hits around mile 1,000, at the beginning of Northern California.

Hiker Claire Henley Miller, who ended up quitting at mile 1,232 in 2015, described this phenomenon in her book: “It began as something new and invigorating and had lasted in this way for many suns and moons. But now, after participating in mile after mile of this one continuous event, the journey had turned into a mundane chore of waking, walking, and setting up camp; an ongoing cycle of wash, rinse, repeat.”

“Why did I end my hike with only 250 miles until Canada?” 2015 hiker Brett Pallastrini asked in his journal. “I was done hiking. I was mentally over it.”

Whether hiking a trail or pursuing other projects, the feeling of being “over it” can be so strong that we abandon goals that once excited us, even goals that we have the potential to achieve. Research into our emotional experiences around habits can help explain this phenomenon and keep us on track with our goals.

The downside of habits

Habits, those automated actions we repeat at regular intervals, help us achieve goals. Want to lose weight? Make a habit of eating breakfast instead of skipping it. Want to write a novel? Make it a habit to wake up a half hour early and write. The link between habits and goals is so compelling that it has generated multiple bestselling books.

What no one mentions—but those Pacific Crest Trail hikers saw—is that those same habits that you establish to achieve your goals can turn on you. When we get too accustomed to a particular behavior we perform en route to a goal, we are more likely to quit. Like a marriage that has gone stale after too many years together, our goal becomes boring, and we look for new thrills.

In one study, University of Southern California psychology and business professor Wendy Wood and her colleagues asked college students to record what they were doing at one-hour intervals for a day or two: studying, exercising, or socializing, for example. They also asked students how they felt about that behavior on a scale that ranged from very negative to very positive.

Wood found that when performing habitual behaviors, students reported feeling less intense emotions—and, in particular, less pride. This was true even when the behaviors had once been enjoyable, like watching TV or hanging out with friends. It was also true for behaviors that were important to achieving long-term goals, Wood says. Working and studying, two activities that contribute to a future career, were not especially pleasant or unpleasant for students when performed habitually.

Wood explains this phenomenon, the so-called “double law of habits”: “Repetition has multiple effects,” she says. “One is to strengthen the memory trace for an action, so that habitual tendencies get stronger. The other is to weaken your emotional response (boredom starts), so that you are no longer getting much kick from what you are doing.”

Even habits as longstanding and simple as brushing your teeth are plagued by the habituation problem, Wood says. If you give people toothbrushes that monitor when they brush their teeth, you find that most people brush consistently in the morning, to eliminate bad breath, but evening tooth-brushing gets neglected when they are too tired or busy.

“We speculate that people whose lives are characterized by large proportions of habitual behavior can find that their emotional experiences become dull and subdued over time,” write Wood and her colleagues. One of Wood’s graduate students is currently investigating this question further.

How to combat habit boredom

While there is plenty of advice on how to establish habits to help you meet your goals, there is little research about what to do when those habits get boring. So what do we do in the meantime?

One way that people overcome this challenge is by figuring out how to add interest, fun, or passion back into those habits that move them toward their goal. You add passion back into a marriage by doing things you find fun together: going on date nights, for example. You can make habits compelling again in the same way.

For their 2015 hike, Catie Joyce-Bulay and her group downloaded a smartphone app with riddles—some of which took a day or two to solve. Her group also tried thinking of all the word combinations that PCT could stand for (Pina Colada Time, Partially Castrated Tiger). Other hikers turn their focus to blogging about the hike, or spend their hiking hours listening to books on tape they had always wanted to read—in other words, sharing their experiences with others or keeping their minds occupied.

But beware: Paradoxically, we sometimes reduce our enjoyment even further in attempting to reinvigorate our drive. It can be tempting to challenge yourself with new behaviors that set the bar higher; for example, you might push yourself to work on your novel for 45 minutes every morning, instead of a half hour. But just making any change, even if it is a change that is beneficial for achieving your goal, doesn’t make an activity more engaging.

“You want to change things up to make it more fun again, not less fun,” Wood says. Thinking hard about what makes something fun for you is vital.

Focus on changing your behaviors so they bring you intrinsic joy, that sense that you love what you are doing and it is right for you. Université du Québec à Montréal professor Robert Vallerand’s work on harmonious passion finds that when we are engaged in activities that bring us that sense of joy, we tend to work harder and perform better. If you are able to introduce joy into the habits you perform en route to your goal, you may have greater success at reaching it.

Focus on changing your behaviors so they bring you intrinsic joy, that sense that you love what you are doing and it is right for you.

If your goal has gone stale, take a cue from the hikers and think about how to make it more compelling again.

For example, say your goal is to eat more healthfully. After deciding to add more vegetables and whole grains to your diet, you’ve gotten into a good routine of cooking healthy dinners for the last few months. Suddenly, you find yourself ignoring your planned recipes and stopping by McDonald’s after work more and more often. Your habit of cooking a healthy dinner has turned on you; it became boring and drove you to McDonald’s.

The solution? Sit down and brainstorm new ways to eat vegetables and whole grains that you would find appealing. Do you love going out to restaurants? Plan to go out to dinner twice a week for the next month and order only vegetable dishes. Do you think trying new recipes is fun? Challenge yourself to cook every grain recipe in the Joy of Cooking.

Of course, we don’t want to adopt behaviors that will compromise our ability to achieve our goals. “The challenge,” Wood says, “is to figure out how to change things up enough in your head while still keeping up efficiency.” If every vegetable dish you order at restaurants is loaded with cream and cheese, the additional fat you’re adding to your diet might compromise your original goal to eat more healthfully.

It is normal to be “over it” at some point as you work toward your goals. When this happens, you can decide to gut it out or try to liven up the process. Adding fun back into a dull routine is a more successful strategy, especially when you’re further away from the finish line.