You don’t have to do this and let yourself degrade. Many engineers I know including myself don’t. You have to prioritize your health and there is definitely room to work on software and stay healthy if you make it a priority. The first step is not to work for a hellish company that wants you slugging away 80+ hours a week.
It's not exactly a skill they teach you at college. Once you understand concept of work-life balance by yourself it's a bit late and takes huge effort to recover.