I've found explaining the situation to another person helps. Usually having to make coherent statements about a thing causes me to realize what I am failing to put together. Also, often whatever obvious thing I am failing to see stands out clearly to someone with fresh eyes. Those eyes could be someone else's. Or they could be your own. Did you know that the human eye constantly moves around even when its staring at…
This really helps. I once spent a couple weeks trying to figure something out. A quick trip to the local coffee shop and a chat with a fellow programmer fixed things. By the time I was done explaining where I was, I already saw where the issue was and knew how to fix it. He didn't have to say anything. Just talking it out can really help.