When I get to that state, I immediatly start talking to myself, or my imaginary friend.
I have a habit of blaming myself for everything that has gone wrong, as if I feel I deserve to be punished.
What I do to make the situation better is that I start meditating and fill my thoughts with love. Love can never go wrong.
That doesn't work for more than half the time though.