The Messenger of Allah ﷺ said, "The best things a man can leave behind after his death are three. A righteous child who prays for him, an ongoing charity whose reward reaches him, and knowledge that is acted upon after him."
قال رسول الله ﷺ: خير ما يخلف الرجل من بعده ثلاث: ولد صالح يدعو له، وصدقة تجري يبلغه أجرها، وعلم يعمل به من بعده.
Ibn Majah reported it (241), and Ibn Hibban graded it sahih (93), both through the route of Ismail bin Abu Kareema Harrani, who said, Muhammad bin Salama narrated to us, from Abu Abdul-Rahim (he is Khalid bin Abu Yazid bin Simak), who said, Zayd bin Abu Unaysa narrated to me, from Zayd bin Aslam, from Abdullah bin Abu Qatada, from his father, and so he mentioned it. Its chain of transmission is sahih. The discussion of it is set out in detail in the Book of Knowledge, in the chapter that beneficial knowledge does not have its reward cut off.The hadith indicates that the deceased benefits from the good works he left behind, such as an ongoing charity, beneficial knowledge, or a righteous child who prays for him. As for what benefits the deceased through the deeds of others, this includes charity given on his behalf, prayer for him, Hajj and Umrah performed on his behalf, making up missed fasting, paying off his debt, fulfilling a vow on his behalf, and the righteous deeds done by his righteous children. These are among the deeds for which there are sahih and explicit texts establishing that the deceased benefits from the deeds of others, and they are documented in their proper places. These are among the exceptions to His saying, "and that man will only have what he strove for" [Najm 53:39].As for his benefiting from the recitation of Fatihah or other portions of the Quran, with the reward dedicated to him, this is a matter of disagreement, and the sahih and preferred position is that he does not benefit from it. His eminence Shaykh bin Baz, may Allah have mercy on him, said, "Had dedicating recitation been prescribed, the righteous predecessors would have done it, and analogy is not permissible in matters of worship, because such matters are fixed by revelation and are only established by a text from the word of Allah or from the sunnah of His Messenger ﷺ." End of quote.As for prayer, tawaf, voluntary fasting, and other good deeds, the sahih view is that their reward does not reach the deceased, without disagreement.