Surah Al-An'am — Ayah 131 (6:131)
ذَٰلِكَ أَن لَّمۡ يَكُن رَّبُّكَ مُهۡلِكَ ٱلۡقُرَىٰ بِظُلۡمٖ وَأَهۡلُهَا غَٰفِلُونَ ١٣١
English translation (Saheeh International)
That is because your Lord would not destroy the cities for wrongdoing1 while their people were unaware.
- - Or "unjustly."
Brief commentary
The reason for sending messengers to mankind and jinn is so that no one is punished for the crimes they committed without a messenger having been sent to warn them and the invitation reaching them. I only punished a nation after sending messengers to them.