Stress causes more stress
I just learned one of those “very obvious” things, that wasn’t so obvious until someone else said it.
Stress is a response to a difficult situation, originally it was to activate our survival instinct, the flight-or-fight response, that has been in our nature since before we turned into humans.
When we were wild animals, this helped us to scape predators or use extra strength if it was needed, but for modern life it’s not of much use. This I knew for a long while. What I just learned is that our logical/reasoning also gets affected, the more stress, the less capable of reasoning we are (thus, we are getting ready to fight .. or flight), and if the stress is caused for a situation where you have to use your brain, things can go down spiral. Because you're not thinking clearly, the problem that's stressing you can't be solved. As a result, you get more stressed and think less and less clearly.
For these kind of situations the possible solution to break the vicious cycle to to take break and relax, although this might seem counter intuitive, you go on the weekend and instead of relaxing you’re still thinking aabout that problem. So, an intermediate solution can be attempted, instead of trying to solve it by working harder, try to solve it by taking breaks, talking with someone (a rubber duck if needed) , go for a walk, get distracted for a bit and then go back to work. Usually, what has helped me is to talk to someone and slowly explain everything I'm trying. They can often suggest something, even if you've already tried it.
Sometimes it is hard trying to relax so the stress doesn’t go off the roof, but it might be just the right thing to do. Realize that you're not in danger (if you're not) and that the problem you're trying to solve is an interesting one. Communicate with others so they are aware of the status of the problem and hopefully if a solution cannot be found, a workaround might emerge.