We know that in all things God works for the good of those who love him. Paul does not speak of blind optimism here. He speaks of a deep conviction: God works in everything, even in the hard things.
That does not mean everything is good. It means God works in everything. Even in what you do not understand. Even in what hurts. He wastes nothing. In the New Covenant you are not at the mercy of chance.
Today you can trust that God uses even what you cannot make sense of.