Better yet, when do you clear your head when a problem comes up? If you have been trying to push through a problem, keep working till you get it right, banging your head against the wall to knock out all the bad ideas... You may need a new method to flush out that solution to your problem. Admittedly this is more related to the people who have 1st world problems and normally sit to do their work. Regardless, when you have a problem and you need to noodle on it pretty hard, you should be doing something completely different than what you are doing now. The subconscious has almost all of the answers you need to solve the problem at hand. Getting the subconscious to do the work for you is what we are talking about here.
When up against a wall of a big problem, sometimes, you need to step away from it and let the smarter part of your brain kick in. Options here are boundless and each person is different. Just like sharpening the axe, taking a break from the current problem can allow your brain to do the work it does best. I've had solutions or developed a better picture to solve a problem in the shower.
Sometimes, stepping away will help you solve the problem faster and better.