Quran 39:49 — The Throngs (Al-Zumar)
If the human is touched by adversity, he implores us, but as soon as we bestow a blessing upon him, he says, "I attained this because of my cleverness!" Indeed, this is only a test, but most of them do not know.
[39:48] The sinful works they had earned will be shown to them, and the very things they used to mock will come back to haunt them.
[39:50] Those before them have uttered the same thing, and their earnings did not help them in the least.