^When troubleshooting something that's not working, or fixing something that's not going your way, do all that you can do, plan your next steps as far as you can, then STOP. And go do something else.
Then, after a time, go back to it. The reason so many people bang their heads against the wall is they forget to take a breather for an hour or two. Do something mindless. Stop thinking obsessively about it and get your mind onto something else.
This gives you perspective, backs you out of the narrow tunnel you found yourself in and sometimes the RIGHT tunnel is not so far away. But it would have remained inaccessible if you DIDN'T stop and do something else for a short time, before returning to the thing at hand.
A P.S.: This move is potentially dangerous, as it annoys people around you that don't understand what you're doing. Also, you mustn't wait TOO long or else you'll forget some valuable details.^