As for you, you meant evil against me, but God meant it for good in order to bring about this present result, to preserve many people alive.
Genesis 50:20 NASB
This is Joseph in Egypt talking to his brothers after their father died. His brothers were afraid Joseph would try to get revenge on them for selling him into slavery many years before. You can read the story of Joseph beginning in Genesis 37 and continuing in chapter 39 to the end in chapter 50.
This is one of my favorite Bible stories because it has given me hope that God can take difficult circumstances and turn them around and use them for good!