I think every coder runs into this problem eventually. Especially when you first get into it. It can be difficult to find the motivation to keep working on a project or even to start a new one. Can't think of a new project? Stuck on an issue with your current project? It's always easier to give up but in the long run it will pay off.

I hit the wall all the time when it comes to my side projects. Sometimes I'll find a bug that is going to take a ton of work to iron out, and then I decide to blow it off and never return. The trick for me personally is to take a breather and set a hard time that I will return back to the issue. Take some time to relax and reset your brain. Smashing your face to the screen over and over is not going to help.

The worst thing you can do is not finish your projects. If you never finish a project you are most likely running from the problem. If you hit the wall and give up you're not going to learn. Hitting a problem will enable you to learn. You'll learn from your mistakes and improve a programmer.