One of the biggest struggles I've had in the past few weeks is finding focus. When I know I need to knuckle down and get some work done, I get myself all pumped up, then sit down at my computer and fall into a pit of distraction.

It's not always bad distraction, like wasting time in Slack or browsing Product Hunt. Often it's that most nefarious of distraction types: productive procrastination. I get caught up in things that are ostensibly necessary and useful for my job, but they take my attention away from my most important task: writing.

Whether it's the appeal of variety that comes from doing different tasks, or simply a way to avoid work that stretches me beyond my comfort zone, distraction has become the bane of my productivity score lately.

Always one for experimenting and self improvement, I've been looking into ways to ameliorate this situation and get my focus back.

If you're in the same situation as me, may these techniques help you get more of the important work done and waste less of your time. Or, you know, just boost your productivity score if that's what you're into.

Step 1: Figure out why you're distracted

Your problem with focus probably isn't the distractions themselves.

One of the most empowering approaches to improving focus is to realise that there's likely an underlying cause to why you keep getting distracted. Figuring out this cause and fixing it is a more sustainable approach than using willpower or forced focus tools to keep your mind from wandering.

One problem could be motivation. If you're not interested in what you're doing, it's easier to get distracted. In fact, you might want to be distracted without realising it. You're susceptible to distractions because you don't actually want to focus on what you should be doing.

As Chris Guillebeau, author of The Art of Non-Conformity says, forcing yourself to focus when you're not interested in your work isn't a sustainable approach:

It’s very hard to be productive in the long-term when trying to do things for which you aren't motivated. You might have to "suck it up" once in a while to complete a certain task, but for the "big rocks" it's much easier to construct your work around things you’re excited about.

The useful part of recognising that your lack of focus comes from some underlying cause is that it's usually something internal. Whether that's a lack of motivation, a feeling of frustration or fatigue, or excitement about something else you'd rather be working on, those reasons for being distracted come from within.

Which means it's unnecessary to put lots of time and effort into blocking out every distracting website you can, or chaining yourself to your desk.

Oliver Burkeman explained this well in a piece for 99u:

When we think in terms of temptations and interruptions, we’re defining the problem as coming from the outside—so it makes sense to try to shut them out with website blockers and noise-cancelling headphones, by snapping at bothersome colleagues, or by escaping to a cabin in the mountains. But there’s a reason such methods never seem to work very well, or for long. The real culprit isn’t external irritations, but rather an internal urge to be distracted, to avoid focusing on what matters most. The calls are coming from inside the house.

Oliver also points out that we don't need to be motivated in order to get our work done:

Instead, let yourself feel like you'd rather be doing something else, and at the same time, do the work: Open the laptop, make the phone call, type another sentence.

Recognise why you're distracted so you can treat the underlying cause.

If you're lacking motivation, recognise that feeling but do the work anyway. (I'll show you how to psych yourself up with a pre-game ritual below.)

If you're bored, or just not used to focusing for long periods, you can train your focus muscles. I'll show you how in step 3, below.

Step 2: Create your own pre-game ritual

Have you ever noticed how athletes tend to perform the exact same ritual, in the exact same way, before every competition or match? A pre-game ritual is a set of actions that you can repeat the same way every time to get yourself into the right mindset.

Here's a real-world example of the difference a pre-game ritual can make: suppose you have a regular morning routine that consists of walking to work at a leisurely pace, grabbing a coffee at your favourite café on the way, and stopping to buy a salad for lunch in the salad bar next to your building. By the time you get to your desk you've done some gentle exercise, been out in the fresh air, drunk your coffee, and bought your lunch. You sit down ready to get stuck into work feeling calm and organised.

Now suppose you sleep in one day and then spill your breakfast on your clothes and have to get changed. You're running late now, so you drive to work. You don't have time to stop for a coffee or a salad, so you're de-caffeinated and you don't have lunch prepared when you get to the office. Because you're late, your emails are already piling up and you've only got a couple of minutes at your desk before your first meeting of the day.

See how your mindset would be thrown off just because your routine was different? You've developed a relaxing, organised ritual that gets you to work refreshed and ready to concentrate. Without it, you're late, scattered, stressed, and unorganised.

Developing a ritual will give you a go-to tool to get you in the mood for work every time. It also helps you to overcome the distractions that stop you from starting. Your ritual will help you get stuck into your work, and before you know it you'll be off-and-running, just because you found a way to get started in the first place.

Another important note about a pre-work ritual: the ritual needs to move you towards starting work, but you don't have to think about work while you do the ritual. You only need to think about the ritual itself. On the way to work you're thinking about walking, navigating traffic, enjoying your coffee, what kind of salad you'll have for lunch. You don't need to think about what you'll do when you get to work. Just focus on the ritual itself, and if you design it well, it'll get you into the right mindset for work by the time you've finished it.

James Clear uses pre-game rituals to get himself in the mood for working after realising how much they improved his baseball game. James says that eventually your ritual should become so tied to your performance that just by doing it you'll be primed to perform. He also suggests a few tips for building the perfect pre-game routine:

Make it so easy you can't so no . "You shouldn’t need motivation to start your pre–game routine," he says.

. "You shouldn’t need motivation to start your pre–game routine," he says. Include physical movement . According to James, "It's hard to think yourself into getting motivated." Physical movement is hard to fight, though.

. According to James, "It's hard to think yourself into getting motivated." Physical movement is hard to fight, though. Follow the same pattern every time. The more you do it, the better it works.

Step 3: Train your focus muscles

If you really can't focus for long (enough) periods even when you're motivated to get your work done, your focus muscles might need some training. Luckily it is possible to increase the amount of time you can focus on one thing for. It just takes some practice.

The important difference here is that you're not forcing yourself to ignore distractions, which isn't sustainable, but rather training yourself to be able to focus on one thing for longer periods.

Author Cal Newport says most of us have a grace period of maybe 20 or 30 minutes to work on anything that requires demanding thinking before our focus starts to drift. He likens this feeling to "a weight descending inside your skull":

Your energy fades and you begin to experience a desperate craving for novel stimulation. Nothing in the world seems more tempting than to go seek such stimulation — to check your e-mail, or sift through your Facebook feed like a hyper-extroverted gold prospector.

Cal quotes novelist Haruki Murakami, who believes in training to write for several hours at a time just like you might train to run a marathon. Murakami's suggestion, according to Cal, is to "sit down every day at your desk and train yourself to focus on one point."

Just like a runner would build up their endurance to run a long distance race, Murakami says it's possible to build up focus endurance. Each day, he says, you need to push yourself a little further outside your comfort zone. Stretch your focus muscles a little more every day, and over time your threshold will increase.

Exceptional things — be it ideas, writing, mathematics, or art — require hard work. This, in turn, requires boring stretches during which you ignore a mind pleading with you to seek novel stimuli — "Maybe there's an e-mail waiting that holds some exciting news! Go check!". — Cal Newport

What to do next

Figure out why you're getting distracted. Are you craving distraction? Why would you rather be doing something else besides what you need to do right now? Create a pre-game ritual to get you in the mindset for work. Repeat this ritual every day before you sit down to work. Help your brain make the connection between your ritual and what comes next, so the ritual itself starts getting you psyched up to work hard. Train your focus muscles. If you're struggling to focus for long stretches even when you're motivated to work, push yourself to focus for just a little longer than is comfortable each day.

I love what writer Austin Kleon has to say about the effort required to create great work:

Let go of the thing that you’re trying to be (the noun), and focus on the actual work you need to be doing (the verb).

Doing the verb will take you someplace further and far more interesting than just wanting the noun.

Doing the verb isn't glamorous, but it's necessary. And with a little effort and a lot of practice you can build up the ability to focus on hard work without letting boredom, frustration, or outside influences distract you.