Why do we go through bad times?

   A lot of people will ask If God is good, why do bad things happen to good people? Everybody goes through bad times, even and sometimes especially Gods people. But why does God allow His people to have bad things happen to them? First, its important to understand that bad things dont come from God, Satan is the author of all evil. Also its important to remember that God is in control, Satan only gets away with what God allows him to. And God only allows things that will work toward His perfect purpose. Romans 8:28-30says;
And we know that for those who love God all things work together for good, for those who are called according to his purpose. For those whom he foreknew he also predestined to be conformed to the image of his Son, in order that he might be the firstborn among many brothers. And those whom he predestined he also called, and those whom he called he also justified, and those whom he justified he also glorified.

Even though we cant see what good is in the situation, or even how any possible good could come from it, we have to trust God that He knows better and is going to work everything out for his perfect will. When we can do this, we can be comforted by the fact that even though we dont understand, God is going to turn the situation into good somehow. Isaiah 55: 8-9 says;
For my thoughts are not your thoughts, neither are your ways my ways, declares the LORD. For as the heavens are higher than the earth, so are my ways higher than your ways and my thoughts than your thoughts.

Another thing that we need to understand is that no matter how bad the situation is, God wont give us more than we can handle. 2 Cor. 4:8-9 says
We are afflicted in every way, but not crushed; perplexed, but not driven to despair; persecuted, but not forsaken; struck down, but not destroyed;

God created us, He knows us better even than we do and what we can handle. Hes not going to destroy us or let us be destroyed by Satan. But sometimes He does let us have more than we can handle on our own. Sometimes Gods will is for Him to get us through it. When we are in trouble, its always best to call on the Lord for help.
Cast your burden on the LORD, and he will sustain you; he will never permit the righteous to be moved. (Psalm 55:22)

What other reasons would God have for letting bad things happen? One reason is to make us stronger. God knows whats ahead for us and wants us to be strong enough to handle it. By getting through trials now, we will be better to get through more in the future, or help others get through similar situations. When people see us getting through tough situations by trusting in God, especially people who dont know God, we bring glory to Him. And as Christians, that is our purpose.
Another reason God lets bad things happen is to get our attention. If we arent listening to God, Hell let things happen to get our attention. He may have already tried little things and we either ignored them or just werent paying attention. Its kind of like an old mechanics adage, if it doesnt work, try a bigger hammer If small things dont get our attention, God gets a bigger hammer and allows bigger things to happen. The story of Saul in Acts 9 is a good example of God using a sledgehammer to get Sauls attention.
Another reason bad things happen is because God loves us. God does not want us to make wrong decisions, and will use discipline to teach us. Hebrews 12: 6-11 says;

For the Lord disciplines the one He loves, and chastises every son whom he receives. It is for discipline that you have to endure. God is treating you as sons. For what son is there whom his father does not discipline? If you are left without discipline, in which all have participated, then you are illegitimate children and not sons. Besides this, we have had earthly fathers who disciplined us and we respected them. Shall we not much more be subject to the Father of spirits and live? For they disciplined us for a short time as it seemed best to them, but he disciplines us for our good, that we may share his holiness. For the moment all discipline seems painful rather than pleasant, but later it yields the peaceful fruit of righteousness to those who have been trained by it.
No matter what the reason, God loves us and does not enjoy seeing anyone go through trials even those who dont believe in Him. In Ezekiel 18:23 the bible says this:
Have I any pleasure in the death of the wicked, declares the Lord GOD, and not rather that he should turn from his way and live?
If you are going through trials, go to God. Ask Him for help in your situation, and understanding of His will and how He will work good out of it. Sometimes, He will let us see His plans and how He is using the situation, Sometimes its not for us to know but to trust in Him. But know one thing, God will always help.