Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:64:15

Your wealth and your children are but a trial, and Allah has with Him a great reward.  

Your possessions and your children are only a trial, for you, distracting ˹you˺ from the concerns of the Hereafter, and God — with Him is a great reward, so do not forfeit it by preoccupying yourselves with possessions and children.
القرآن:٦٤:١٥

إِنَّمَا أَمْوَالُكُمْ وَأَوْلَادُكُمْ فِتْنَةٌ ۚ وَاللَّهُ عِنْدَهُ أَجْرٌ عَظِيمٌ  

{إنما أموالكم وأولادكم فتنة} لكم شاغلة عن أمور الآخرة {والله عنده أجر عظيم} فلا تفوتوه باشتغالكم بالأموال والأولاد.

See similar narrations below:

Collected by Qurʾān
quran:8:28

And know that your properties and your children are but a trial and that Allah has with Him a great reward.  

And know that your wealth and your children are a trial, for you, impeding you from the concerns of the Hereafter; and that with God is a tremendous wage, so do not forfeit it by giving ˹undue˺ attention to wealth and children, acting treacherously for the sake of ˹preserving˺ them.
القرآن:٨:٢٨

وَاعْلَمُوا أَنَّمَا أَمْوَالُكُمْ وَأَوْلَادُكُمْ فِتْنَةٌ وَأَنَّ اللَّهَ عِنْدَهُ أَجْرٌ عَظِيمٌ  

{واعلموا أنما أموالكم وأولادُكم فتنهٌ} لكم صادة عن أمور الآخرة {وأن الله عنده أجر عظيم} فلا تفوِّتوه بمراعاة الأموال والأولاد والخيانة لأجلهم، ونزل في توبته.