Consider a mid-level PhD student in a STEM field (maybe 2-3 years into the program), he and his advisor are working on something relatively new and interesting but they have reached a point where the research isn't moving ahead. How do you get out of this situation?
All papers have been read, colleagues have been consulted and top-of-the-head alternatives considered but the problem isn't moving ahead. No theory, computation or intuition helps. The only possibility left is to (optimistically) wait for a Hollywood moment when it all comes together.
Where do you go from here assuming that you cannot completely abandon that topic? At what point should you "start searching for other problems"? How do you choose what to work on next (should you start anew or pick something allied)?
two possible suggestions:
let it go. Take a break, or start a new project. But not for good - come back to it after a month, two months, maybe even half a year. A fresh look on the problem might be useful.
this will (a) give your mind the time needed to consider it with no pressure, and (b) will allow you to have alternatives for the case the project is a dead end.
Try to go in the "opposite direction" to what you've done so far. I mean, if you are trying to prove something, and it just doesn't work, assume it is false and now try to prove it wrong. Maybe you'll succeed (which is already a progress), but even if not, this might give another insight to the core of the problem and how to solve it.
Deciding when a project is a "dead end" is a tough decision, and I would say that's the role of your advisor (which depends on your current status: funding, time to graduate, current publications, and of course your advisor's estimation of the probability to solve it eventually).