It's the only thing that seems to consistently work for me. When I was so emotionally overwhelmed I couldn't focus and it took me half a day to begin working, I would switch to doing pomodoros and rewarding myself for achieving a certain amount any given day. I tried punishing myself through not achieving too (via Beeminder), but that ended up worsening my emotional negative feedback loop, so I stopped.
Over the past decade, with tremendous help of my wife, I've managed to resolve some of my anxiety issues, so these days my main sources of work anxiety are: 1) trying to do a thing I have no first clue how to approach, and 2) the tension between spending time coding for money vs. doing hobby projects. If I do too much of the latter, I don't have money, but if I do too little, I burn out quickly. So I reward my work time with hobby project time. I keep a small pad on which I put a tally mark for each pomodoro spent on working. These tally marks represent pomodoros I can then spend on hobby projects (software on otherwise) guilt-free. This satisfies my emotional self, as I literally work to earn time to spend doing something else.
In practice, I end up buffering tally marks and then spending them in batches, this fits well with me being an independent contractor (I can work less today if I worked more yesterday), and also works well for the state of flow: if I have 10 pomodoros buffered up, I can let myself spend them all in 5 hours of continuous hacking.
I'd say the key thing here is getting rid of the guilt: I've agreed with myself that as long as I never exceed the accumulated pomodoro budget, I can spend it without feeling bad about not working.
(Well, the second big trick was to block HN on my router during work hours; this ensures I actually get to both earn and spend my pomodoros, instead of procrastinating here all day.)
(EDIT: Well, the third big trick, one which lets me keep anxiety down, is that I keep running journals - both personal and work - and I dump my train of thoughts straight into them whenever I start feeling even slightly anxious or confused. I almost never read them again, but the act of going through my thoughts in writing calms me down, and lets me pinpoint the sources of anxiety.)