Genesis 50:20

20 You intended to harm me, but God intended it for good to accomplish what is now being done, the saving of many lives.

Read Genesis 50:20 Using Other Translations

But as for you, ye thought evil against me; but God meant it unto good, to bring to pass, as it is this day, to save much people alive.
As for you, you meant evil against me, but God meant it for good, to bring it about that many people should be kept alive, as they are today.
You intended to harm me, but God intended it all for good. He brought me to this position so I could save the lives of many people.