.(Verily, We will indeed make victorious Our Messengers and those who believe in this world's life and on the Day when the witnesses will stand forth.)40:51 Allah, the Exalted, also says,
And 0 my people, let not your hostility towards me cause you to suffer what was suffered by the people of Nuh, or the people of Hud, or the people of Salih. And the people of Lut are not far from you.
The sense of the last sentence is that the overturned habitations of the people of Sayyidna Lut (علیہ السلام) were close to Madyan where they were. Then, in terms of time, the punishment that came upon them was very close. From this they could learn their lesson and leave their obstinacy.
In the present world, the opportunity to live and to settle is available to man for the sole reason that he has to be put to the test. Those who continue to deny the truth even after the conclusion of the preaching process by the prophets, lose their right to remain on God’s earth any further. That is why God destroyed the rejecters of the Prophet ( 29:40 ). Mostly this destruction took place in the form of the severest natural calamities. For example, cyclones, floods or earthquakes which, under normal conditions, remain within a limit, were made to wreak havoc to an unlimited extent. Such destruction of communities as took place in the past were called ‘climatic pulsation’ by the scholars of geographic history, as if whatever happened was the result of a geographical upheaval. However, they are unable to explain why such ‘climatic pulsations’ (changes) occurred only in the past and why these do not occur now, after the end of the period of prophethood. The fact is that these events were not merely geographical events in the simple sense. They were manifestations of God’s will. This proves that the system of the present world is based on justice. Here, according to the law of nature itself, a transgressor will perforce receive punishment for his transgression, while the righteous one will receive a reward for his just behaviour. To call these events ‘climatic pulsation’ amounts to consigning them to the geographical realm. On the contrary, if these are treated as forms of divine retribution, they can teach great lessons about the fear of God and create anxiety about the Hereafter. The events that occurred during the age of the prophets, were, so to say, small signs prior to the advent of the great Doomsday. In these cases it so happened that those who denied the truth were given respite for some period. Thereafter, God’s verdict was made manifest and all were destroyed. Only those were saved who, being the supporters of the truth, were treated as favoured in the eyes of God. Others who were, in the assessment of God, arrogant and, therefore, disfavoured, were directly afflicted by God’s retribution; so much so that the recommendations of the prophets could not save them, as proved by the examples of Noah and Abraham.
Uthmani text of the Madinah mushaf (King Fahd Complex). Translation: Saheeh International. Tafsir via Quran.com.