Surah Al-A'raf, ayah 95

7:95

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

Thumma baddalnā makānas-sayyi'atil-hasanata hattā 'afaw wwaqālū qad massa ābā'anad-darrā'u was-sarrā'u fa akhadhnāhum baghtatan wahum lā yash'urūn

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."383 So We seized them suddenly while they did not perceive.384

Footnotes

383 Instead of being grateful to Allāh for His blessings, they merely attributed them to the changing fortunes of time.

384 That they had been tried and tested.