The Prophet ﷺ recited "Competition for worldly gain has distracted you, until you visit the graves" [Takathur 102:1–2], and said, "The son of Adam says, 'My wealth, my wealth!' Yet your wealth is only what you have eaten and consumed, or what you have worn and worn out, or what you have given in charity and sent forth."
أخبرنا عمرو بن علي قال حدثنا يحيى قال حدثنا شعبة عن قتادة
عن النبي ﷺ قال {ألهاكم التكاثر حتى زرتم المقابر} قال يقول ابن آدم مالي مالي وإنما مالك ما أكلت فأفنيت أو لبست فأبليت أو تصدقت فأمضيت
Muslim narrated it in the Book of Zuhd, chapter on "The World is a Prison for the Believer and a Paradise for the Disbeliever," hadith 2958, from the hadith of Shubah, through him. It is also in al-Kubra, hadith 6440.