But as for you, you meant evil against me; but God meant it for good, in order to bring it about as it is this day, to save many people alive. (Genesis 50:20 NKJV)
Genesis 50:20New Revised Standard Version Catholic Edition (NRSVCE)
20 Even though you intended to do harm to me, God intended it for good, in order to preserve a numerous people, as he is doing today.