I quit my job about 4 months ago feeling the onset of burnout. I was completely useless for most of that time but have just recently managed to get back into creative work.

By the way, look up comments by the Hacker News user ahoyhere (Amy Hoy). It was her comment on the physical causes of burnout that motivated me to quit when I did. I think that nipped in the bud something that could have become much worse.

You mention you keep working because of "shame" and "having to pay the bills". Hypothetical situation: if you had another medical condition, say a heart attack, and your doctor ordered you to take 3 months in bed, could you do it? Live off savings, move in with your parents, etc?

If you're really living on the edge financially (no savings, in debt, no support network) then keep working. But, my theory is that people in that situation don't feel "burned out" - they feel stressed and exhausted, maybe, but they're motivated to keep moving. Burnout is when you're pushing hard on something that feels ultimately pointless. For me, it was working on a project I knew was going to fail, a position I could have financially walked away from at any time, but I stayed because I felt it wasn't socially acceptable to walk.

After I quit my job I had a background anxiety on what I'd do when my savings ran down and I needed to find something else. I honestly thought I'd rather Howard-Roark it and lug boxes around in a warehouse or work as a garage mechanic than write code for money ever again. (Funnily enough I'm also in SE Asia, Chiang Mai right now). What saved me was easing my way back into goal-directed activities, but goal-directed activities which I found intrinsically fun and rewarding - swimming, playing strategy games, riding a motorbike around. Eventually I wanted a more challenging project and took 2 weeks to research and write a long article for an online blog, unpaid but I treated it as a full-time job.

Just this last week I've finally got back into coding again, and realised that I enjoy frontend web coding, making something which looks cool and which you can show to people. I was a very good CS student and used to think I should work on something more challenging than HTML/CSS/JS, but - frontend web dev is something I know I can well enough to be useful.

Engineers have a problem that we're always "failing". Our work is so complex and error-prone. In most other jobs its hard to tell how well you're doing. Salespeople are one other group who also "fail" often, but salespeople also get a lot of social validation and buzz when they succeed. Engineers don't, and combined with their low self-esteem end up feeling they need to hit 100% accuracy, everything done on time with no bugs, or they're below par. Clueless and disinterested managers don't help.

Having rediscovered my confidence in one particular specialism (frontend web dev) is very powerful. If in future I encounter another hairy, undocumented ball of PHP and JS - I'll simply tell whoever's responsible that I can't fix it until they fix their workflow. On the other hand, if I find a good team, with technical (or at least technically-aware) management, realistic goals and a useful product, I know I can be valuable and useful to them.

I'm so glad I quit when I did. Had I stayed another 6 months by burnout may have lasted 3 years, not 3 months. But recovery wasn't a linear process, it was more digging around in my brain until I uncovered my natural sources of motivation.