Life is not the random mess which it may sometimes appear.
We do not always understand what God is doing, let alone welcome it. Nor are we told that he is at work for our comfort. But we do know that in all things he is working towards our supreme good. And one of the reasons we know this is that we are given many examples of it in scripture. For instance, this was Joseph’s conviction about his brother’s cruelty in selling him into Egypt: “You intended to harm me, but God intended it for good…the saving of many lives. Similarly, Jeremiah wrote in God’s name a letter to the Jews in Babylonian exile after the catastrophic destruction of Jerusalem: “I know the plans I have for you,” declares the Lord, “plans to prosper you and not to harm you, plans to give you hope and a future.” The same concurrence of Human evil and divine plan had its most conspicuous display in the cross, which Peter attributed both to the wickedness of man and to ‘God’s set purpose and foreknowledge’-- Him, being delivered by the determined purpose and foreknowledge of God, you have taken by lawless hands, have crucified, and put to death
From: John R W Stott, The Message of Romans