God’s goodness means we get things we don’t deserve. If we believe in the goodness of God we can look to the future with hope.
For the LORD is good; His mercy is everlasting, and His truth endures to all generations.
God purposes for us is of course in the future and which we cannot presently see. That “good” includes our salvation, sanctification, and our future full adoption as sons of God. It will involve being tested perhaps by suffering, as the “good” which is spoken of here is not so much happiness as holiness.
So the “all things” which God causes to work together for our ultimate good includes hardship, includes our failures and our sins, our innocent suffering, for the cause of Christ, and that suffering which results from our sin and stupidity.