The Messenger of Allah ﷺ said, "When a person dies, his deeds come to an end except for three things: an ongoing charity, beneficial knowledge, or a righteous child who prays for him."
أن رسول الله ﷺ قال: إذا مات الإنسان انقطع عمله إلا من ثلاث: صدقة جارية، أو علم ينتفع به، أو ولد صالح يدعو له.