Surah Al-A'raaf

7:95

ثُمَّ بَدَّلْنَا مَكَانَ ٱلسَّيِّئَةِ ٱلْحَسَنَةَ حَتَّىٰ عَفَوا۟ وَّقَالُوا۟ قَدْ مَسَّ ءَابَآءَنَا ٱلضَّرَّآءُ وَٱلسَّرَّآءُ فَأَخَذْنَٰهُم بَغْتَةًۭ وَهُمْ لَا يَشْعُرُونَ

Then We exchanged in place of the bad [condition], good, until they increased [and prospered] and said, "Our fathers [also] were touched with hardship and ease." So We seized them suddenly while they did not perceive.

Tafsir 7:95

After trying them with suffering and illness Allah improved their situation and turned their suffering into well-being and safety, until they became many and their wealth increased, and they said that the bad and good that they had experienced was a normal part of life and that the same thing had happened to their ancestors before them. They did not recognise that there was a lesson to be learned in the difficulties that occurred to them and that there was a test for them in the good that they were given. Then Allah overtook them suddenly with the punishment, while they were unaware of it and did not expect it.