English Translation of Hadith
Hazrat Ibn Umar (May Allah be pleased with them) said: The Messenger of Allah [SAWW](PBUH) said, "If Allah afflicts punishment upon a nation, it befalls the whole population indiscriminately and then they will be resurrected and judged according to their deeds.”
[Al-Bukhari Book 09, Chapter 88, Hadith # 224]
Lesson : as mentioned above in Surah Al- Ankabut Ayat 21. “He punishes whom He will, and shows mercy to whom He will, and to Him you will be returned” When Allah’s punishment comes to pass, it does not distinguish between the upright and the wicked. However, the pious people will be saved from punishment after their death while the wicked ones will be punished in the Hell. May Allah save us from all types of punishments.