Az-Zumar • BN-TAFSEER-IBN-E-KASEER
﴿ فَإِذَا مَسَّ ٱلْإِنسَٰنَ ضُرٌّۭ دَعَانَا ثُمَّ إِذَا خَوَّلْنَٰهُ نِعْمَةًۭ مِّنَّا قَالَ إِنَّمَآ أُوتِيتُهُۥ عَلَىٰ عِلْمٍۭ ۚ بَلْ هِىَ فِتْنَةٌۭ وَلَٰكِنَّ أَكْثَرَهُمْ لَا يَعْلَمُونَ ﴾
“NOW [thus it is:] when affliction befalls man, he cries out unto Us for help; but when We bestow upon him a boon by Our grace, he says [to himself], “I have been given [all] this by virtue of [my own] wisdom!” Nay, this [bestowal of grace] is a trial: but most of them understand it not!”
Please check ayah 39:52 for complete tafsir.