Sahih Muslim 2960
Sahih Muslim · Book 55: The Book of Zuhd and Softening of Hearts
Anas b. Malik reported Allah's Messenger (ﷺ) as saying:
حَدَّثَنَا يَحْيَى بْنُ يَحْيَى التَّمِيمِيُّ ، وَزُهَيْرُ بْنُ حَرْبٍ ، كِلاَهُمَا عَنِ ابْنِ عُيَيْنَةَ ، قَالَ يَحْيَى أَخْبَرَنَا سُفْيَانُ بْنُ عُيَيْنَةَ، عَنْ عَبْدِ اللَّهِ بْنِ أَبِي بَكْرٍ ، قَالَ سَمِعْتُ أَنَسَ بْنَ مَالِكٍ ، يَقُولُ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم " يَتْبَعُ الْمَيِّتَ ثَلاَثَةٌ فَيَرْجِعُ اثْنَانِ وَيَبْقَى وَاحِدٌ يَتْبَعُهُ أَهْلُهُ وَمَالُهُ وَعَمَلُهُ فَيَرْجِعُ أَهْلُهُ وَمَالُهُ وَيَبْقَى عَمَلُهُ " .
Three things follow the bier of a dead man. Two of them come back and one is left with him: the members of his family, wealth and his good deeds. The members of his family and wealth come back and the deeds alone are left with him.