Finding balance isn't something that is taught in school, in courses or in the professional setting. At least it hasn't been in my experiences.
It's taken me burning out and slowly and still recovering to find a balance I'm comfortable with. I code on weekends for fun sometimes but the project has to light that fire of inspiration otherwise it's just not worth it anymore.
That has been my experience post burnout anyway. If you're becoming cynical of your job role, or people you work with take a step back and check yourself for signs of burnout.. Change jobs and effort levels and find something you align with more.