Surah Al-A'raf 7:168
وَقَطَّعْنَـٰهُمْ فِى ٱلْأَرْضِ أُمَمًا ۖ مِّنْهُمُ ٱلصَّـٰلِحُونَ وَمِنْهُمْ دُونَ ذَٰلِكَ ۖ وَبَلَوْنَـٰهُم بِٱلْحَسَنَـٰتِ وَٱلسَّيِّـَٔاتِ لَعَلَّهُمْ يَرْجِعُونَ
And We divided them throughout the earth into nations. Of them some were righteous, and of them some were otherwise. And We tested them with good [times] and bad that perhaps they would return [to obedience].
Translation: Saheeh International
Tafsir
And We divided them We separated them into communities sects in the earth. Some of them are righteous and some of them people who are otherwise disbelievers and wicked individuals. And We tried them with good things with graces and evil things with misfortunes so that they might revert from their wickedness.
Excerpt from Tafsir al-Jalalayn, commentary on 7:168, via Quran.com. The reader has the full commentary and 9 more tafsirs.