Genesis 50:20

20As for you, you meant evil against me, but aGod meant it for good, to bring it about that many people
Or a numerous people
should be kept alive, as they are today.

Proverbs 16:4

4 cThe Lord has made everything for its purpose,
even dthe wicked for the day of trouble.
Copyright information for ESV