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:28:78

He said, "I was only given it because of knowledge I have." Did he not know that Allah had destroyed before him of generations those who were greater than him in power and greater in accumulation ˹of wealth˺? But the criminals, about their sins, will not be asked.  

He said, ‘In fact I have been given it, that is, ˹this˺ wealth, because of knowledge I possess’, in other words, in return for it — he was the most knowledgeable of the Children of Israel in the Torah, after Moses and Aaron. God, exalted be He, says: Does he not know that God had already destroyed before him generations, communities, of men stronger than him in might and greater in the amassing?, of wealth; in other words, he does know this. And God destroys them, and the guilty will not be questioned about their sins, because of God’s knowledge of these ˹sins˺, and so they will be admitted into the Fire without a reckoning.
القرآن:٢٨:٧٨

قَالَ إِنَّمَا أُوتِيتُهُ عَلَىٰ عِلْمٍ عِنْدِي ۚ أَوَلَمْ يَعْلَمْ أَنَّ اللَّهَ قَدْ أَهْلَكَ مِنْ قَبْلِهِ مِنَ الْقُرُونِ مَنْ هُوَ أَشَدُّ مِنْهُ قُوَّةً وَأَكْثَرُ جَمْعًا ۚ وَلَا يُسْأَلُ عَنْ ذُنُوبِهِمُ الْمُجْرِمُونَ  

{قال إنما أوتيته} أي المال {على علم عندي} أي في مقابلته وكان أعلم بني إسرائيل بالتوراة بعد موسى وهارون قال تعالى {أوَلم يعلم أن الله قد أهلك من قبله من القرون} الأمم {من هو أشد منه قوةً وأكثر جمعا} للمال: أي هو عالم بذلك ويهلكهم الله {ولا يُسأل عن ذنوبهم المجرمون} لعلمه تعالى بها فيدخلون النار بلا حساب.