Despair comes without invitation. It can shake you up when you face crises in life.
A few things can help you stay on track.
One, God is merciful and compassionate. He can help you and he is willing to. Call out on his Name and pour out your heart to him. You need not even say a word. Even without words he hears the burden of your heart.
Two, hope is what you need to hold on to. When you look at the hopeless situation you are in, you might have every reason to despair. But remember if you fall into the water, the first thing to do for survival is try to keep your head above water until help comes. Hope is that attitude.
Thirdly, get up out of dead-end thinking. What does it mean? Despair often comes when your thinking happens along the same lines again and again. Try to think creatively. There will be more options to solve pressing problems than you think.
Above all do not act out anything when your emotions are like a swirling current. Let this night pass. Just hold on. Tomorrow is a new day.