The Messenger of Allah ﷺ said, "The best of what a man leaves behind after his death are three things. A righteous child who prays for him, an ongoing charity whose reward continues to reach him, and knowledge that is acted upon after him."Abu al-Hasan said, Abu Hatim narrated to us, Muhammad bin Yazid bin Sinan al-Ruhawi narrated to us, Yazid bin Sinan, meaning his father, narrated to us, Zayd bin Abu Unaysa narrated to me, from Fulayh bin Sulayman, from Zayd bin Aslam, from Abdullah bin Abu Qatada, from his father, who said, "I heard the Messenger of Allah ﷺ," and he mentioned something similar.
حدثنا إسمعيل بن أبي كريمة الحراني حدثنا محمد بن سلمة عن أبي عبد الرحيم حدثني زيد بن أبي أنيسة عن زيد بن أسلم
قال رسول الله ﷺ خير ما يخلف الرجل من بعده ثلاث ولد صالح يدعو له وصدقة تجري يبلغه أجرها وعلم يعمل به من بعده قال أبو الحسن وحدثنا أبو حاتم حدثنا محمد بن يزيد بن سنان الرهاوي حدثنا يزيد بن سنان يعني أباه حدثني زيد بن أبي أنيسة عن فليح بن سليمان عن زيد بن أسلم عن عبد الله بن أبي قتادة عن أبيه سمعت رسول الله ﷺ فذكر نحوه