God trains us and strengthens our faith through hardships...
Sometimes God blesses us with things the world calls "good," sometimes with things the world calls "bad." But we know that everything God does is good.
He may punish(1) wayward Christians to bring them back to the fold, but most of our hardships in life are due to our fallen world and our need for growth.
We messed up God's perfect world (Genesis 3), but He, in His Romans 8:28 fashion, uses our mess to stregnthen our faith (Hebrews 12:5-7).
When parents insist their children clean their rooms, do their homework, or sit still in church, the children are usually unaware that they're developing self-control so they can grow into responsible adults.
But with God's help we can get past this childish attitude and appreciate difficult lessons. We can "greatly rejoice" in difficulty, knowing it strengthens our faith and results "in praise, glory and honor when Jesus Christ is revealed." 1 Peter 1:3-9
(1) See God Punishes and Discipline, Punishment, and Condemnation