In case you are unaware, coder's block happens when you sit down to code, know what you want to build, but unable to come up with an elegant way of execution.
Has this happened to you? How do you combat the problem?
Either do what these guys say and walk away and do something completely different (I find often even a walk to the shop and back clears my head) or if that's not the problem try a test-first approach to development (test driven development), which enables you to solve the problem the other way around, often leading (after refactoring) to an elegantly simple implementation.
Work on something else - pick a small big to fix, an alignment issue - something small that won't take you more then 5-10 minutes to fix. Do a couple if you have to / have a back log.
Another that has worked for me - work on a different feature - step away from the problem you had to work on, and work on a different one. While you do that, your mind will be working on the original problem and it might be more clear when you come back to it.
As for the walking away / going for a walk or something - a long hot shower might help - I can't tell you how many times I came up with ideas just standing in the shower, listening to the water and not really thinking about anything. It's almost like meditation.
Some of my personal projects last for years since I don't have a solution for it. So I will stop and work on others and weeks past I may make some progresses.
More people have said this, my two main solutions: try again tomorrow. I can't count the times I've struggles with a problem, only to fix it the following day within minutes. There other one is running/jogging - clear your mind!
Same like @JanVladimirMostert and @DennyTrebbin said. Do something else. Go for a walk often helps. In the company I go in the kitchen and get a cup of coffee and talk with my workmates.
Like @JanVladimirMostert said, leave the problem and do something else instead.
Walk away from the PC, go get some fresh air, come back later and try again.
Just this, works every time.
Panagiotis Peikidis
Write quick and dirty code, refactor, quick and dirty, refactor, quick and dirty, and so on and so forth.
I have found that by doing this not only do I overcome coder's block, but sometimes discover implementation details I didn't expect when planning/designing/estimating the problem. Furthermore, if the changes are small enough, you can rewrite the whole thing with a better, more rounded, solution.