> places a lot of self-worth in the quality of his work ...

I felt exactly the same way, but over the years I've learned that it's a little more complicated for me. For context, I'm a Senior (Blah Blah Blah) ... 2 decades making stuff with code.

I place a lot of demands on myself regarding the quality of my work.

I place a lot of my own self-worth on the value of my work.

Burnout happens when my work has no value (to me and/or anyone else) any longer. This can be for many reasons, but it's typically because I've recognized that the thing that I'm working on either serves no good purpose, or simply serves no purpose at all. Less frequently, it's because I've reached the end of what I can do/learn -- i.e. that rare occasion where you can go to your boss and say "I'm done, I've finished all of my work" and you literally mean it. It runs. There are no more features. Yeah, I can refactor it another hundred times, but there's literally no reason for me to be here any longer unless I want to make-work myself[0] into a new reason for being here like I did the last 30-or-so times.

On the demand side -- I can be a bit nuts about doing things right. I've been around the block -- "best" and "practice" aren't meant ironically -- there are times it is "correct" to break practice in favor of performance, working around a leaky abstractions, actual "correctness" of the outcome requires it. There are times it is "correct" to agonize over architecture details, calculate pricing to the penny/hour/minute). But sometimes that agonizing is being done because if it weren't, there'd be no reason to write the thing in the first place.

Your last paragraph hints at something a lot bigger going on in your life, so without details I can't help you terribly well except to say:

(1) Don't believe that the situation you've gotten yourself into is unique -- you are not the first to go through it, you won't be the last[0]. There's a solution. It may be "hard" but "hard" problems but I'm guessing if you frequent here you have a few good strategies for breaking down/solving hard problems. If not, well, that's basically the gist of it.

(2) Is all of this hinting that maybe "getting through" burning out might be best done by making a change to whatever the "big thing" is that burned you out? For me, I was in a systems job when I wanted to be writing software. So I scripted my job out of existence and writing web-based intranet software became my job (early 00s) within a year and a half.

(3) Life, necessarily, involves trials/suffering. My brain is naturally wired up to resist and fear any major change (e.g. changing schools when I was young, changing jobs/careers as an adult) that comes with a large amount of unknowns. The only thing that works for me is remembering that every single other past, major, change -- including the ones that went terribly -- were all somewhere in the range of "far less awful than I thought" to "incredible things that I regret not doing sooner".

(4) Be thankful. This is not meant as "First World Shaming" (I have no idea where you live, so there's that!). I can't speak to you, but for me, even at the worst times there has been plenty of good standing right in front of me. At some point I realize I'm actively choosing to be miserable and I either (a) condition myself to focus on everything/everyone that I love in my life or (b) solve whatever it is that is causing me to choose to be miserable. But from that point forward, I actively attack any self-pity with a reminder that I am now actively working toward solving that problem, so I can choose to focus on how great things are going to be when I have completed executing my plan.

Nope, it doesn't always work. Most of that advice would fall into things that self-help books peddle pretty hard but who's success is limited to that of the author of the book (and most of the time, probably not even that), but I wish you well and hope you emerge victorious!

[0] There was a great song around 07-08 timeframe "This too shall pass" who's music video went viral. I loved it because I was going through some awful stuff at the time and sometimes a simple phrase can calm your mind, but I really appreciated the video. It was a room-sized Goldberg setup that ran the length of the song. The metaphor worked. There are quiet moments, loud moments, and a lot of mess. The worst experience of my entire life made the best part of my life as it is now, possible.