Sometimes what helps me is to fully understand the problem then move on and start working on other things and try as hard as possible not to think of a solution.

At some point..... minutes, days or weeks later a solution will force itself into my mind that is inescapable.

Also this sometimes yields no solutions but I usually started out with a problem I couldn't solve so at worst I'm back where I began