With burnout it's simple, rest. Get away, go spiritually connect with something new, like laying on a beach or doing something completely new. Burnout is real and will make you _hate_ anything.
I watch for burnout in my teams, and become burned out myself at times, but if you're burning out, tell somebody and get moved elsewhere. Coder doing some star-coder stuff the last 6 months, but can do sysadmin/devops things? Switch to that for a few weeks and come back mentally rested.
Legal protections against burnout I'm not aware of but the illness associated with elevated stress levels and 'burn out' do create other health complications.
Burn out is bad, bad stuff. Once somebody's burned out they can't do _anything_
[dead]