Sure Az-Zumar

39:49

فَإِذَا مَسَّ ٱلْإِنسَٰنَ ضُرٌّۭ دَعَانَا ثُمَّ إِذَا خَوَّلْنَٰهُ نِعْمَةًۭ مِّنَّا قَالَ إِنَّمَآ أُوتِيتُهُۥ عَلَىٰ عِلْمٍۭ ۚ بَلْ هِىَ فِتْنَةٌۭ وَلَٰكِنَّ أَكْثَرَهُمْ لَا يَعْلَمُونَ

Wenn dem Menschen Unheil widerfährt, ruft er Uns an. Wenn Wir ihm hierauf Gunst von Uns gewähren, sagt er: "Es ist mir nur gegeben worden aufgrund von Wissen." Nein! Vielmehr ist es eine Versuchung. Aber die meisten von ihnen wissen nicht.

Tafsir 39:49

When a disbelieving man is afflicted by sickness, poverty etc. he calls out to Me to remove his affliction. Then when I bless him with health or wealth, the disbeliever says: Allah has only given me this because He knows that I deserve it. Actually it is a test and a means of luring him to his destruction. But most disbelievers do not know this and they are deceived by the blessings Allah gives them.