مِثْلَ دَأْبِ قَوْمِ نُوحٍ وَعَادٍ وَثَمُودَ وَٱلَّذِينَ مِنۢ بَعْدِهِمْ ۚ وَمَا ٱللَّهُ يُرِيدُ ظُلْمًا لِّلْعِبَادِ Qur’an Ghafir (40:31)Mithla dabi qawmi noohin waAAadin wathamooda waallatheena min baAAdihim wama Allahu yureedu thulman lilAAibadi
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.'