مِثْلَ دَأْبِ قَوْمِ نُوحٍ وَعَادٍ وَثَمُودَ وَٱلَّذِينَ مِنۢ بَعْدِهِمْ ۚ وَمَا ٱللَّهُ يُرِيدُ ظُلْمًا لِّلْعِبَادِ Qur’an Ghafir (40:31)Mithla dabi qawmi noo h in waAA a din wathamooda wa a lla th eena min baAAdihim wam a All a hu yureedu th ulman lilAAib a d i
I.e., those sinners were not wronged by what befell them in this world: they had deserved it. The next two verses refer to the Day of Judgment.
'All these disasters happened in history, and they will happen again to you if you do not give up evil. Do not for a moment think that Allah is unjust. It is you who are deliberately preparing the disasters by your conduct.'