It’s a proverb I’ve never forgotten: The same sun that melts the ice hardens the clay.
Said another way: When bad things happen to you, you can either become bitter or better.
God is indeed using all things for good for those who love him and are called according to his purposes (Romans 8:28). God always uses all things for good. Even though - at the time - we are unable to see it.
Why? Because in our humanness, we have developed preconceived notions about certain circumstances that we - not God - deem to be adverse. Bad. Harmful. Hurtful. Detrimental.
But God says otherwise.
Even if a person may have intended something to harm you, God can - and will - use it for good (Genesis 50:20). There are many examples of this principle in the Bible, but perhaps none as illustrative as the life of Joseph in Genesis 37-50.
Always trust God. He uses everything for his purposes. In his timing and seasons (Ecclesiastes 3:1-11).
For your good. And his glory.