It depends on what the problem is. Sometimes you just need to take a day off and recuperate or work through your problems or spend time with loved ones or whatever will help you deal with the stuff that's going on in your life.
Other times, it's just time to move on, or working will distract you in a productive way from something you can't change, or it's not a problem that merits taking time off. So what then?
Here are some things that work for me:
- start the workday with a 10-15 minute free write (pen and paper, not keyboard) about what's on my mind and distracting me. Sometimes we just need to take some time to acknowledge what we're feeling and think it through in order to be able to set it aside for a few hours.
- take 5-20 minutes for a short meditation session. It gives you the mental space to be calm and focused and reminds your brain what that feels like.
- write down a list of 1-3 things that MUST get done that day. If it's not on an actual, meaningful hard deadline or blocking someone else, it's not a must.
- work out and write down the smallest action that can be taken to get started on each of those tasks: open a blank email and address it; open a specific file of code and add a breakpoint; etc.
- do a couple small, self-contained tasks to get a quick "win" - even if they're not important ones. Complete that low-priority ticket about changing a font color, or add an email filter to get that LinkedIn recruiter spam out of your inbox, or find a couple reams of paper to lift your external monitor to a better viewing angle.
- if all else fails, caffeine is excellent for enhancing focus, especially if you use it infrequently.