عَنْ عَائِشَةَ رَضِيَ اللَّهُ عَنْهَا قَالَتْ قُلْتُ يَا رَسُولَ اللَّهِ ابْنُ جُدْعَانَ كَانَ فِي الْجَاهِلِيَّةِ يَصِلُ الرَّحِمَ وَيُطْعِمُ الْمَسَاكِينَ فَهَلْ ذَاكَ نَافِعُهُ قَالَ لَا يَا عَائِشَةُ إِنَّهُ لَمْ يَقُلْ يَوْمًا رَبِّ اغْفِرْ لِي خَطِيئَتِي يَوْمَ الدِّينِ
Sayyida Aisha (may Allah be pleased with her) says: I asked, "O Messenger of Allah! Ibn Jud'an used to maintain ties of kinship during the time of ignorance and feed the poor. Will these good deeds benefit him?" The Prophet (peace and blessings be upon him) replied: "No, Aisha! He never said, even for a single day: 'O my Lord! Forgive my sins on the Day of Resurrection.'"
Brief Explanation
Benefits: … Ibn Jud‘an’s acts of maintaining family ties and generosity, etc., will not benefit him, because he was a disbeliever. The intended meaning of “do not pray for him” is that he did not have faith in the Hereafter, therefore his deeds have been rendered void.