One of the hardest things you can do is look for the light in the darkness, find the good in the bad, and learn that something good is coming out of this bad situation. We go through what we do for a reason and God doesn't put us there and then desert us; there is a greater purpose behind all things we face whether or not it's what we planned on.
Finding the good in that bad situation and looking to God for that good helps you to get through it. Looking for good and understanding that better is coming makes perseverance a lot more natural and is motivation to get past this bad situation. Even situations where it seems impossible for something good to come from it, it is possible.
If something doesn't go your way, maybe you're meant for greater things than that. If something bad happens to you, you now have the experience of the situation to help someone else that will later face that same situation. There is always good to be found, no matter how bad the situation may be. God has good for you, He is just waiting for you to look to Him. Don't give up and don't set yourself up to only face bad.
Don't lose faith in God or the good because He is always there and it is always there. The moment you lose faith is the moment you have determined how the situation will end up. Keep going and don't quit. It's a lot easier said than done, but I'm living proof that it is possible. You can get through this and you can say that good never left, but you have to keep going. The good is so close you can touch it, so start looking. Start searching for the good in whatever you are facing. Start declaring good in this situation and in God's name. Start expecting good in this situation. Good will come when you start expecting it instead of hoping for it.
"The righteous cry out, and the LORD hears them; he delivers them from all their troubles. The LORD is close to the brokenhearted and saves those who are crushed in spirit."
Psalm 34:17-18