I disagree about burnout. Taking time off could possibly be the worst thing.
In my experience personally and observing others, burnout is most often caused when you have a disconnect between expected reward (monetary, status, or emotional) for labor and actual reward for labor, effectively negatively reinforcing labor. It's especially bad when the miss is uncorrelated to performance, e.g. political or business decisions derail your e.g. promotion or payoff.
Taking a break to mitigate burnout can thus make the next cycle worse. A better choice is to take structured vacations at set points in the future, and when you feel like a missed expectation is likely or has happened, reinforce the work-reward relationship by doing little work things that create pops of success. The counterintuitive thing is that a strategy to counter burnout is more work (but carefully curated to nearly guarantee success)
For programming, I find going into an intense refactoring or debugging cycle is helpful (making green dots out of red ones is immensely satisfying)... When I was a biologist, I found doing routine "never fail" procedures like molecular biology to be helpful after an experimental failure or catastrophe, like staying up on an all nighter and coming back the next day to find a procedural error had ruined the whole thing
> For programming, I find going into an intense refactoring or debugging cycle is helpful (making green dots out of red ones is immensely satisfying).
For me personally whenever I have felt burned out by programming I just went over to one of those competitve programming sites and solve one of their problems. It is also cool seeing your rank move in correlation with others. I know if I quit peogramming for a week then I will actually feel less motivated to code.
Satisfying and constructive work with clear finish, clear product and clearly helpful to finishing goals all help with burnout a heck of a lot.
They help with depression too.
Burnout: taking time off is a sufficient cure.
Depression: you cannot feel pleasure even at points of success when everyone else is, and it won't be so if you changed anything else about the job.
Laziness: you are not unhappy or unwell but notice other people with roughly your skillset and responsibility are more productive.
Wrong job: you are arguing a lot with people or taking a lot of criticism for having legitimately valid alternative opinions or ways of doing things.