The Holy Quran 7:147 — Surah Al-A'raf
Arabic text
وَٱلَّذِينَ كَذَّبُوا۟ بِـَٔايَـٰتِنَا وَلِقَآءِ ٱلْـَٔاخِرَةِ حَبِطَتْ أَعْمَـٰلُهُمْ ۚ هَلْ يُجْزَوْنَ إِلَّا مَا كَانُوا۟ يَعْمَلُونَ
Translation
Those who reject Our Aayaat and the meeting of (Allaah in) the Aakhirah, their actions are wasted (in the Aakhirah they will have no rewards for their good actions). (However, no injustice will be shown to them because) They will be punished only for the (sinful) actions that they carried out (and not more). (The Kuffaar will receive the rewards for their good actions in this world only.)
Tafsir (excerpt) — Tafsir Usmani
That is, they will not be granted the ability to follow Allah's commands, and whatever they do by their own reasoning will not be accepted by Allah. As they act, so shall they suffer. As for whatever reward is due for their lifeless and dead good deeds, they will receive it in this world.
Preview. The full text opens with JavaScript enabled.