It’s a very good question, I was actually just about to post one like it myself!
Yes, bad things will happen to good people. I think confronting evil is a part of the road to Heaven. It’s something we all have to confront to find God on the other side . . . if that makes any sense. The only thing that really matters in the end are the decisions we make, e.g. the decision to follow God.
I think we can define “bad” as something that causes us pain or suffering. There are two reasons for these bad things: 1) Nature. It’s just the nature of our world, which is not paradise. We can get diseases, hurricanes and earthquakes can strike, etc. 2) The confrontation with evil. We can get in physical fights, wars, terrorists want to kill us, which is rooted in other souls rejecting God. We must confront both of these really just because they exist, and we can’t stop them from existing. Part of being good is allowing evil to exist. Okay, that doesn’t sound like what I mean, but what I’m trying to say is that for good to exist, evil must also exist, and to know what good is you must know what evil is. Thus we are confronted with it, and it may cause us to suffer
temporarily as we continue our search for God.
To quote from the Bible:
“The Spirit itself bears witness with our spirit that we are children of God, and if children, then heirs, heirs of God and joint heirs with Christ, if only we suffer with him so that we may also be glorified with him.
I consider that the sufferings of this present time are as nothing compared with the glory to be revealed for us. For creation awaits with eager expectation the revelation of the children of God; for creation was made subject to futility, not of its own accord but because of the one who subjected it, in hope that creation itself would be set free from slavery to corruption and share in the glorious freedom of the children of God. We know that all creation is groaning in labor pains even until now; and not only that, but we ourselves, who have the firstfruits of the Spirit, we also groan within ourselves as we wait for adoption, the redemption of our bodies. For in hope we were saved. Now hope that sees for itself is not hope. For who hopes for what one sees? But if we hope for what we do not see, we wait with endurance. In the same way, the Spirit too comes to the aid of our weakness; for we do not know how to pray as we ought, but the Spirit itself intercedes with inexpressible groanings. And the one who searches hearts knows what is the intention of the Spirit, because it intercedes for the holy ones according to God’s will. We know that all things work for good for those who love God, who are called according to his purpose.” Romans 8:16-28
Whew, long quote! But sometimes it almost moves me to tears!
All suffering will end forever when we reach the gates of Heaven.

(And I am quite sure when we get to Heaven we will have a full understanding of why we had to suffer)