This was a hard lesson to learn for me as well. It is something I strive for now though even running my own business. I maintain boundaries like strict work hours and try to keep my work away from my life outside of work.
After 5 jobs, I can tell you it will never be an easy call, even if you dont really like the job, company is sinking, bad management, etc. But like the initial commenter said, less attachment helps and time will perspective.