The Messenger of Allah ﷺ said, "Three things follow a deceased person to the grave: his family, his wealth, and his deeds. Two return and one remains. His family and his wealth return, while his deeds remain with him."
أخبرنا قتيبة قال حدثنا سفيان عن عبد الله بن أبي بكر قال سمعت
قال رسول الله ﷺ يتبع الميت ثلاثة أهله وماله وعمله فيرجع اثنان أهله وماله ويبقى واحد عمله
Bukhari transmitted it in the Book of Riqaq, Chapter on the pangs of death, no. 6514, and Muslim in the Book of Zuhd and Riqaq, Chapter on the world being a prison for the believer and a paradise for the disbeliever, no. 5/2960, from the hadith of Sufyan bin Uyayna with this chain, and it is in Kubra, no. 2064.