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 Ar-Rum [The Romans] Ayat 19. “Allah brings out the living from the dead, and brings out the dead from the living” 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.