I have had a lot of rough times since I split with my ex, especially since I have been separated from my kids but one thing I always did was force myself to go to work and the gym. Not to compete like back in the day, but as Biteme said, I guess I viewed it as part of my job. In addition if I do not go I will lose mass and this will hasten my physical degradation. I have kids that are depending on me for everything so that just isn't an option. So I suck it up and go. Many workouts are half-ass, but I always feel better after I am done. At least I did something for myself. It forced me to eat, do shower and get dressed, etc. When I first split with my ex and had no job to go to, I wouldn't eat or bathe or even turn the lights on when he took my kids out of the house for the weekends or when the kids were in school.
So just look at the gym as part of work.
Also, believe it or not I cry a lot. I mean sob hysterically and it feels good to let it out. But I can only do this in private. Either in my car or in my place alone (I don't like for people who know me to hear me like that - my pain is very private.) or actually if I am in a crowd. But then it is only tears and no noise. Believe it or not because I am an anonymous face lost in a crowd, I feel totally alone so I can cry no matter how long I need to, but it is only in silence in this situation.