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.