عَنْ أَبِي هُرَيْرَةَ رَضِيَ اللَّهُ عَنْهُ أَنَّ النَّبِيَّ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ قَالَ إِذَا مَاتَ ابْنُ آدَمَ انْقَطَعَ عَمَلُهُ إِلَّا مِنْ ثَلَاثَةٍ إِلَّا مِنْ صَدَقَةٍ جَارِيَةٍ أَوْ عِلْمٍ يُنْتَفَعُ بِهِ أَوْ وَلَدٍ صَالِحٍ يَدْعُو لَهُ
Narrated by Sayyiduna Abu Hurairah (may Allah be pleased with him) that the Noble Prophet (peace and blessings be upon him) said: When the son of Adam dies, all his deeds come to an end except for three: ongoing charity, beneficial knowledge from which benefit is derived, and a righteous child who prays for him.