Everyone processes negative emotions the same way, the action taken might be different but the process goes like this.
You think of something in the past that triggers a negative emotion, for me it was anger, and because i am in this state,
i look for something to change it, it can be junk food or drugs or drink, but it could also be praying, a set of burpees, a run, a walk you get what i am saying.
use training as that thing, next time your feeling like shit, bang a set of 20-30 burpees and tell me that doesn't change your mood.
the issue is most people choose an action that makes things worse.
recognising that all you are after in that moment is relief, and that can be done in a more productive manor.