And that man can have nothing but what he does.
So just as no soul shall carry the burden of any other, the soul shall only benefit from the good that one earns for himself.
As for the Hadith recorded by Muslim in the Sahih, that Abu Hurayrah said that the Messenger of Allah said,
إِذَا مَاتَ الاِْنْسَانُ انْقَطَعَ عَمَلُهُ إِلاَّ مِنْ ثَلَثٍ مِنْ وَلَدٍ صَالِحٍ يَدْعُو لَهُ أَوْ صَدَقَةٍ جَارِيَةٍ مِنْ بَعْدِهِ أَوْ عِلْمٍ يُنْتَفَعُ بِه
When a person dies, his deeds will cease except in three cases;-
- from a righteous son who invokes Allah for him, or
- an ongoing charity after his death, or
- knowledge that people benefit from.
These three things are, in reality, a result of one's own deeds, efforts and actions.
For example, a Hadith states,
إِنَّ أَطْيَبَ مَا أَكَلَ الرَّجُلُ مِنْ كَسْبِهِ وَإِنَّ وَلَدَهُ مِنْ كَسْبِه
Verily, the best type of provision that one consumes is from what he himself has earned, and one's offspring are among what he has earned.
The ongoing charity that one leaves behind, like an endowment, for example, are among the traces of his own actions and deeds.
Allah the Exalted said,
إِنَّا نَحْنُ نُحْىِ الْمَوْتَى وَنَكْتُبُ مَاَ قَدَّمُواْ وَءَاثَارَهُمْ
Verily, We give life to the dead, and We record that which they send before (them) and their traces. (36;12)
The knowledge that one spreads among people which they are guided by is among his actions and deeds.
A Hadith collected in the Sahih states,
مَنْ دَعَا إِلَى هُدًى كَانَ لَهُ مِنَ الاَْجْرِ مِثْلُ أُجُورِ مَنِ اتَّبَعَهُ مِنْ غَيْرِ أَنْ يَنْقُصَ مِنْ أُجُورِهِمْ شَيْيًا
Whoever invites to guidance, he will earn as much reward as those who follow him, without decreasing anything out of their own rewards.
Allah said,
وَأَنَّ سَعْيَهُ سَوْفَ يُرَى