I can agree very much with puffer here (especially about the none sweet, high coco chocolate), but I'll add a cuple more.
for me, purely cerebral activity helped a lot at those worst moments, sinse if I could get utterly lost in a cold, rational puzzle, it reduced the impatct of what i was feeling.
I used resource management games for the numerical bit, and spacial logic games such as sokoban, but anything like that could work depending upon your preference, sudocue, solitare, tyle puzzles or whatever. Just make sure there is no time limit to make you panic, and little to no emotional content or story to the game.
Another important factor for me was avoiding isolation. I know some people have used various less healthy coping mechanisms or addictive behaviours. My own addiction was being alone and speaking to nobody sometimes for very extended periods (being alone writing a phd thesis this was easy to do).
I sometimes did not speak to another human for five or six days straight. For me, establishing a point when I had to go and speak to someone each week and sticking to that contact made a lot of sense, even when i felt so worthless I wanted to crawl back home the second I stepped out the door.
If your animal orientated, having a pet can help provided tht your feelings aren't such you'd actually harm the pet in question. interacting with animals is for me at least at some times much easier than with humans (especially dogs), indeed while I still have a problem with physical closeness to a human, I don't with a dog at all, quite the opposite in fact sinse I find a lot can be communicated through touch and physical pressance.
Of course on this front I do have a slight advantage, because I am visually impared and my dog is a guide dog, she is with me literally everywhere I go, thus there are no issues of leaving her at home, plus she is always there with me in public which helps a lot if I'm feeling alone in a crowd.
You could also try various methods to release the pressure of what your feeling so that you can at least have temporary releaf. writing poetry on this i found especially usefull, which is why this site has a section for it. Also, on extreme occasions crying for me helped a lot , indeed occasionally when things really! got too much I'd play music specifically! to make myself cry, then let myself feel the peace afterwards, though because this was itself not a pleasant experience I only did this when I had to.
I really hope some of this helps. Remember it does! get better, even though you might not be able to perceive this from where you are currently (I certainly couldn't when people told me as much).
Luke.