If there is a God, why would he let bad things happen to good people?'
The answer is, 'He loves you.'
God will not permit you to wander aimlessly lost on a path to destruction, instead he will allow things to happen in your life that will bring you to realise that you need Him, that He loves you and He holds the big plan for your life.
You just need to read the book of Job in the Bible to understand how God operates in this area. If you don't read the bible and a whole book seems too much, read the first two and last two chapters. It will give you the general idea.
Whether or not you know God there is someone who is after you, to make sure that you don't know God. Satan knows God, he used to be one of his angels. He hates all of human kind because God loves us so much. So in an effort to avenge his fallen state, he is out to stea,l kill and destroy God's creation - you and me.
The good news is that God does not leave us undefended. Jesus died and lives again so that we may walk in good standing with God. This means we choose to have a new life, for now and forever.
Jesus fights for us, He is our defender and is all powerful. He stands in the gap for us covering our sin and protecting us from the enemy.
The scene below is from the movie 'Lord of the Rings-The Fellowship of the Ring'. Every time I see this scene, God speaks to me about Jesus, and it makes the little hairs on the back of my neck prickle (in a good way).
Photo source: http://www.framecaplib.com/lotrlib/html/episodes/images/fotr/fotr1215.htm
In the movie:
The entire group is running from the enemy. Gandalf stops and turns to face the enemy, sacrificing his life for the sake of his friends and the mission. Gandalf stands in the gap spanning the abyss, defending those on the other side who are running from the enemy. The enemy is huge, towering and menacing ready to destroy them in a single blow. Gandalf raises his staff and sword and booms "YOU SHALL NOT PASS". The enemy comes charging and the bridge breaks, plunging the enemy into the abyss below.
Jesus stands in the gap for us. He turns fearless to face the enemy. The enemy yearns to destroy us.
Jesus declares in power by the sword of his mouth :YOU SHALL NOT PASS! And the enemy runs, his tail drawn between his legs. There are none that can overcome the power of Jesus.
Oh yeah, I know who fights for me. When I lay my head to rest at night I know who holds us past, present and future.
Although circumstances are allowed to try us at times we know that God does not allow us to be crushed by them. He walks with us and all things work together for our own good and His glory.