Even if you get stuck, don’t stay that way!
Sometimes when working on something you may get stuck, be it on a difficult problem or a little detail you can’t seem to get just right. Yes, you’re stuck, and yes, that sucks. But it’s important to not stay staring at it for too long, or you’ll drive yourself insane. Chances are you’ve already experienced what I’m talking about.
Taking a step back and working on something else (or not working on anything at all) relieves a lot of “I must get this thing” pressure and allows your thoughts to deal with a different process. Sometimes, in the background, the thing bothering you will get solved! Other times, you’ll get back to it with a fresh perspective and go “how did I not see that before?”
Even without the benefit of a higher chance of solving things, taking a break is great because working on the same thing for hours (days?) on end just downright sucks.