Habits have a bad reputation, but there are good habits, too—and the right habits have the potential to be life-altering.

A habit is simply a settled or regular activity. Habits feel kind of automatic. We do them without conscious intention, and sometimes we keep doing them, even if our conscious intention is to do something else. We might intend to go to the gym after work, for example, and find ourselves sitting in front of the TV eating chips instead. That’s why people dislike habits: it feels as though habits push us to keep doing bad things.

But imagine having all that power pushing you to do good things?

Habits form whenever we repeat a sequence of behavior the same way many times in a row. Thinking about every single action you have to take to get up and get ready for work would be an exhausting waste, so instead your brain puts the whole sequence on autopilot. Now you can brush your teeth and make coffee while daydreaming about the Planet Mars, if you want to. The problem is that not only do you not have to think about what you’re doing anymore, you literally can’t. The part of your brain that works as an autopilot can’t think. It can’t make decisions. It just runs automatic programs.

No amount of willpower in the world can stop or change a habit, because habits are behavior patterns that are no longer under the jurisdiction of your will. Even the switch to autopilot is automatic. So, you can’t break a habit. But you can replace a bad habit with a good habit.

The switch to autopilot starts with a trigger. Your trigger might be getting on your bike to go to work. Once you sit on that bike, the autopilot engages, and you head to work, even if it’s Saturday and you meant to go to the park instead. If you can identify the trigger, you can replace the bad habit with a good habit that has an earlier trigger. For example, your new habit might be to mentally go over where you want to go, and your trigger might be picking up your bike helmet. Now, by the time you get on your bike, you are already pre-viewing your route to the park, pre-empting the old trigger.

You might hear a lot of stuff about how long it takes to establish a new habit—seven days, 21 days, or some other number. The fact of the matter is, there is no set amount of time. The habit might begin to form very quickly, but still be weak and unreliable. If you continue to go through the new behavior sequence, your habit will get stronger and stronger. Over time, you’ll find you need to put less and less effort in.

But is there a reason to build a habit, other than replacing another habit? Yes! Think about all the important activities in your life that you don’t always want to do. Do you really feel like brushing your teeth every morning? What about bringing your dirty dishes to the sink? Or cleaning the cat box? These kinds of activities don’t do much good unless you do them regularly. The power of habit overcomes laziness and forgetfulness to keep you in the routines that make your life work.

Maybe you want to get in better shape, but keep putting off going to the gym. Maybe you’re that person who never gets around to responding to emails. Whatever it is, a habit can help.

Plan out a behavior sequence that will work for you, such as going to bed early so you can wake up before work and go running. Create a trigger for the new sequence. Be sure to identify any barriers or your new plan (such as a spouse who wants to stay up later) and resolve them. You don’t want to leave yourself any excuses to backslide. Also, identify any habits you already have that might interfere, and design replacement habits to pre-empt those triggers. A workable trigger is one that is linked to something that’s going to happen anyway, either an already-established habit of yours, or some outside event that happens regularly. For example, if your bed-time routine takes an hour and you want to be in bed by nine, then the end of a favorite radio program at eight could be your trigger to start going to bed.

Now, every time you hear the theme music end that radio show, be sure to stop what you’re doing and start getting ready for bed, even if you don’t feel like it. You have to nurture your new habit, or it won’t grow. Cherish your habit. Help it out. And before too long, it will start taking care of you. You’ll probably always have to put some energy into it—if you find yourself thinking “tonight, I’ll just stay up a little later,” it will be up to you to make the decision and stick with your habit. But more and more often, you’ll find that going to bed early (and setting your alarm to go running) feels natural, and you’ll find yourself doing it whether you feel like it or not. Doing the right thing will feel automatic and you’ll be free to think about something else.

I’ve already written about how transformative going to bed early can be. This is how you get there.