Proverbs 16:4

ESV
The LORD has made everything for its purpose, even the wicked for the day of trouble.