Gotta get your mind off the problem to find a solution to the problem, this applies to programming, but it also applies generally to life. Obsessing over a problem you’re facing will make it impossible to find solutions. Go do something else for an hour or two.