Why bad things happened to people?

Sometimes it is brought about by God to reveal his own glory. Seek the Lord when he can be found. John 9:1-3

Most of the time it is Satan who bind people to stumble you. See fasting below. Luke 13:11-16

Lot of cases it is the Satan demanding a test of your faith. Pray to God to avoid temptations and praise God even while under temptations. Job 1-2

Do not think that God is tempting you. James 1:13-14

Many problems in human life is a forceful demand of Sabbath by God from a person. Observe Sabbath to your best. Sabbath

Sometimes God demands the price of the error of fore fathers for generations. Confess the sins of your forefathers and submit them on to the cross. God will release your bondage. Also remember that the best savings you can make for your sons is your righteousness. Nehemiah 13:1-2

Sometimes God wants to give a punishment to you for an error of yours to correct you. Learn from your experiences. 2 Samuel 12:9-23

Sometimes you need to renounce certain things for the Kingdom of God. Matthew 19:12

See also:

Sabbath

Temptation

Fasting