When struggling with a difficult problem that I just can’t figure out I’ve found that it helps to just stop focusing on it and work on something else. Oftentimes that break is enough to get the problem into the subconscious where after a bit of stewing it just clicks. It may feel as if you’re admitting defeat and giving up but that break gives you the respite that is necessary to find the passive inspiration to solve a problem. People say that they often have the best ideas in the shower - in fact Archimedes supposedly found his “Eureka” moment in the bathtub - but I get my moment of inspiration when I’m either waking up, falling asleep, or doodling. In all those cases my mind is wandering and miraculously decides that it actually wants to tackle the problem.