Yup, avoiding burnout is all about having rich alternatives for your time. If you find yourself working yourself to the point that you don't have the energy to do anything else outside of work, you need to cut back.
If you do get burned out, the only remedy I've found is time away, sometimes many months of it. That's really tough (or impossible) for many people's financial situations, though.
Eventually, I got married, had a family, found things to do in the community, and do plenty of sports and hobbies that involve shutting off the computer. Even though my jobs after my 20s have been even more soul-crushing than the ones I had earlier, I've never had a hint of burnout. When I'm done with work, I shut off the computer and that's it. I'll go build a piece of furniture, or repair my car, spend time with my kid, anything that doesn't involve office politics, two week sprints, or status reports. Just having a life outside of work has done wonders for my mental health. No meditation or spirituality needed!