Note: In this Hadith, Rasulullah (sallallahu ‘alaihi wasallam) compared a person’s wealth, family, and actions to three friends. As for the first two, which are his wealth and family, then they will only remain with him during his lifetime. After his demise, neither his wealth nor his family will accompany him to the Hereafter. As for his actions, then whether they are righteous or evil actions, they will remain with him in this world and even after his demise and will accompany him to the Hereafter. Hence, the message of this Hadith is that one should ensure that one does not neglect carrying out righteous actions that will benefit him after his demise.
عن النعمان بن بشير عن النبي صلى الله عليه وسلم قال: ما من عبد ولا أمة إلا وله ثلاثة أخلاء: فخليل يقول: أنا معك فخذ ما شئت ودع ما شئت فذلك ماله وخليل يقول: أنا معك فإذا أتيت باب الملك تركتك فذلك خدمه وأهله وخليل يقول: أنا معك حيث دخلت وحيث خرجت فذلك عمله (مجمع الزوائد، الرقم: 17844)
Hazrat Nu’maan bin Basheer (radhiyallahu ‘anhu) reports that Rasulullah (sallallahu ‘alaihi wasallam) said, “Every person, whether male or female, has three friends. One friend says, ‘I am with you (now), whatever you wish to take from me, then you may take it, and whatever you wish to leave behind, then you may leave it behind.’ This friend refers to his wealth (some of which he benefits from during his lifetime, while leaving the rest behind after his demise). The second friend says, ‘I will remain with you, but when you reach the door of the king (i.e. when you pass away and meet Allah Ta'ala), then I will leave you (at that point).’ This friend refers to his servants and family. The third friend says, ‘I will remain with you, in whichever place you enter and from whichever place you leave (i.e. I will remain with you forever, no matter where you are).’ This friend refers to his actions.”