Aslam

Surah Hud — 11:117
وَمَا كَانَ رَبُّكَ لِيُهۡلِكَ ٱلۡقُرَىٰ بِظُلۡمٖ وَأَهۡلُهَا مُصۡلِحُونَ
And your Lord ˹O Prophet˺ would never destroy a society unjustly while its people were acting rightly.

Commentary

Your Lord, O Messenger, would not destroy any town if its inhabitants were acting correctly on earth. He would only destroy it if the inhabitants were causing corruption by disbelief, disobedience and sins.

Read Tafsir Ibn Kathir