Abu Huraira (RadhiAllahu ‘anhu) reported: Allah’s Messenger ﷺ as saying:
When a person dies, their acts come to an end, but three, recurring charity or knowledge (by which people) benefit, or a pious child, who prays for him (for the deceased).

[Sahih Muslim – Book 13 – Hadith 4005]