I think there are a few things that I've found that always help:
* Removing the source of frustration or the thing that is burning you out -- this might mean quitting a toxic job, reducing hours, whatever. But be honest with yourself, ask for somebody who you talk to a lot to give input on what they think it is and listen.
* Rest. This doesn't have to mean "do nothing" but it can. I think a lot of people do nothing for not enough time. A 2 week vacation and then back to the grind, you may find yourself feeling fresh and re-burnt out in less time than you were gone. I'd say rest more accurately means "do something that is easy but keeps you active" or "do things you've neglected, but don't push the area you're frustrated". I find that working on something that's lower stakes or requires less back and forth and allows me to think through and fix without questions of my dedication or intention are most helpful for me, but for you it might be something else. If burnout is around coding, managing a complex, non coding problem might be helpful. I have friends who have done home improvements or setup beer brewing etc to focus their skills on somewhere lower stakes.
* Do recovery "exercises". If big projects or coding has burnt you out, slowly introduce it in a healthy manner, accounting for the changes you made by removing frustration. This should feel like the most difficult part, because you're attempting to do something new. Introduce the thing you want to do but you've been prevented because of burn-out and try slowly to do it while addressing any strains the source of your injury immediately. This might mean having more candid discussions with managers or team members to prevent toxic patterns from emerging. This may mean tempering expectations early or setting clearer boundaries. Do the hard thing and prevent re-injury. Taper, and don't increase capacity until you're sure you're gaining energy rather than losing it again.
* Be patient. I've been burnt out pretty badly with projects and it's taken several months of healthy, quiet coding in the back seat of a good team to feel well rested again. It's given me a lot of time to assess what went wrong, what I liked and what I have missed about my time resting. I'd say probably 6mo for just a single terrible 2 months of work. Be patient and trust the process.