I can't say I'm in the same situation as you atm, but I have been, and I had to teach myself a new way of thinking to get to where I am now. When you go through trauma, you teach yourself how to cope with it and ultimately become stronger because of it.
I've learned that no matter how hopeless you think things are, things will always get better. But only if you want it to get better. It really is a choice.
Bad things will happen. No matter what. But there's no reason to dwell over it. Just know that things WILL change, and learn to focus on the brighter points of life, and drop the negative ones. You are in full control. Nothing has more authority over your emotions than you do.