In 2009, Fred Stutzman was a graduate student at the University of North Carolina and he was trying to grind out some important work on his thesis.

But there was a problem.

His favorite coffee shop, which had previously been a quiet sanctuary where he could escape distraction and get work done, had just added a new and very dangerous feature.

Wireless internet.

Now Stutzman found himself constantly distracted by the endless supply of entertainment and social media on the web — even if he really wanted to get something done. He tried disconnecting from the internet, but it wasn’t that simple. He was always clicking it back on to “take a break.” He was constantly fighting the urge to check his messages and updates.

Thankfully, Stutzman happened to be a programmer studying Information Science. When he went home that night, he decided to create a software program that would solve his problem.

The program was simple. You turned the application on, told it how long you wanted to focus, and it prevented your computer from going online for that amount of time. If you wanted to get back on before your time was up, you had to turn your computer completely off and reboot.

The program was called Freedom and not long after Stutzman created it, the application went viral. It was picked up by NPR, The Economist, The New York Times, Oprah Magazine, Time, and nearly every major news outlet you can imagine. More than 500,000 people downloaded it.

It seems that many people were struggling with online procrastination.

Why did Freedom work so well? And what can it teach us about sticking to better habits and mastering our willpower?

The Power of Decision Elimination

Making decisions over and over again will drain your willpower. This is true even if it's the same, tiny decision — like constantly resisting the urge to check your email. (Another example: continually trying to follow a new, strict diet.)

You might be able to resist for 5 minutes or an hour or maybe even a week, but eventually, your willpower will begin to fade and you'll give in. This is known as decision fatigue and in a previous article I discussed how it has a measurable impact on your willpower and the choices you make throughout any given day.

The Freedom app that Stutzman designed is effective not only because it prevents you from reaching the web, but also because it reduces decision fatigue. It eliminates your options and, as a result, doing the right thing becomes much easier. In other words, the application places a constraint on your behavior.

This brings us to an important point: constraints can make it easier to stick to good habits by eliminating the number of decisions you need to make to move forward.

Constraints are a Good Thing

People often say that they want options. When it comes to getting things done, however, options aren't always a good thing. When everything is a possibility, it actually becomes harder to make the right choice (or any choice at all). This is the paradox of choice.

Meanwhile, when we place a constraint on ourselves, it can become much easier to get something done. This is especially true if it is a constraint that forces us to start small.

If you want to start exercising, set a rule for yourself where you are not allowed to exercise for more than 5 minutes. You have to stop exercising after 5 minutes. I talked with a reader named Mitch who used this strategy to make his first six weeks of exercise very easy and then gradually built up to doing more. He ended up losing over 100 pounds. (Nice work, Mitch!)

If you want to become more creative, you can use constraints to drive your creativity. For example, you could write a book by only using 50 different words. This is the strategy Dr. Seuss used to write Green Eggs and Ham. (Full story here.)

If you want to eat more vegetables, you could limit yourself to only one type of vegetable this week. By limiting the number of choices you have to make, it's more likely that you'll actually eat something healthy rather than get overwhelmed trying to figure out all of the details of the perfect diet.

We often think that we want an open road and the ability to choose any direction for ourselves. But sometimes, what we need is a tunnel that can reduce our choices and send us in a focused direction.

How can you eliminate the need to make the same decisions over and over again? How can you use constraints to drive your habits forward — even if it's in a very small way?

If you want more practical ideas for breaking bad habits and creating good habits, check out my book Atomic Habits, which will show you how small changes in habits can lead to remarkable results.