When the world comes crashing down, shrink your world. You have to eat. You need shelter, and sleep. Every ten minutes, ask yourself what is the most important thing you have to do in those moments, and do those things. If your head is going too fast to sleep, write those things down and forget them. You'll come back to that sheet later.
Next, find a new job. Maybe better than the old job. You can't find a new job if you haven't been eating or sleeping.
The very, very last thing to ponder is the meaning of life.
Clear your mind for action.