Genesis 45:5–8
5 And now do not be distressed or angry with yourselves because you sold me here, sfor God sent me before you to preserve life. 6 For the famine has been in the land these two years, and there are tyet five years in which there will be neither uplowing nor harvest. 7 And God sent me before you to preserve for you a remnant on earth, and to keep alive for you many survivors. 8 So it was not you who sent me here, but God. He has made me a father to Pharaoh, and lord of all his house and vruler over all the land of Egypt.
Genesis 50:20
20 As for you, you meant evil against me, but iGod meant it for good, to bring it about that many people1 should be kept alive, as they are today.