In John chapter 9 Jesus and his disciples came upon a man who was born blind. The disciples asked Jesus whether it was his own sin or the sin of his parents that caused the man to be born blind. This revealed the assumption among Jews at the time and which is also common among pagan, and often, sad to say, among Christians, that sickness is a punishment for sin and bad things only happen to bad people. Jesus responded that neither the man's own sin nor that of his parents cause his blindness, and proceeded to restore his sight.
When it comes to sin the New Testament is clear that we are all sinners. James 2:10-11 says that we break one of God's laws we are guilty of breaking them all.
Jesus in Luke chapter 13 is very clear that the victims of various tragedies are no worse than anyone else.
1 At that very time there were some present who told him about the Galileans whose blood Pilate had mingled with their sacrifices. 2 He asked them, "Do you think that because these Galileans suffered in this way they were worse sinners than all other Galileans? 3 No, I tell you; but unless you repent, you will all perish as they did. 4 Or those eighteen who were killed when the tower of Siloam fell on them—do you think that they were worse offenders than all the others living in Jerusalem? 5 No, I tell you; but unless you repent, you will all perish just as they did." (Luke 13:1-5 NRSV)The Bible is also very clear that God does not bring these things on people.
13 No one, when tempted, should say, "I am being tempted by God"; for God cannot be tempted by evil and he himself tempts no one. 14 But one is tempted by one's own desire, being lured and enticed by it; (James 1:13-14 NRSV)Throughout the New Testament there runs the idea that while God does not cause the difficulties in our lives he allows them and will use them to help us grow. God will not allow us more than we can handle and will provide the way through. Of course sometimes we wonder why God has some much faith in us and we can always choose ignore the lesson God is teaching and the help God is offering.
2 My brothers and sisters, whenever you face trials of any kind, consider it nothing but joy, 3 because you know that the testing of your faith produces endurance; 4 and let endurance have its full effect, so that you may be mature and complete, lacking in nothing. (James 1:2-4 NRSV)
13 No testing has overtaken you that is not common to everyone. God is faithful, and he will not let you be tested beyond your strength, but with the testing he will also provide the way out so that you may be able to endure it. (1 Corinthians 10:13 NRSV)