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:77

But seek, through that which Allah has given you, the home of the Hereafter; and ˹yet˺, do not forget your share of the world. And do good as Allah has done good to you. And desire not corruption in the land. Indeed, Allah does not like corrupters."  

but seek, in that which God has given you, of wealth, the Abode of the Hereafter, by expending it in obedience to God, and do not forget your share of this world, that is, ˹do not forget˺ to strive in it for the sake of the Hereafter; and be good, to people, by ˹giving˺ voluntary alms, just as God has been good to you. And do not seek to cause corruption in the earth, by committing acts of disobedience. Surely God does not love the agents of corruption’, meaning that He will punish them.
القرآن:٢٨:٧٧

وَابْتَغِ فِيمَا آتَاكَ اللَّهُ الدَّارَ الْآخِرَةَ ۖ وَلَا تَنْسَ نَصِيبَكَ مِنَ الدُّنْيَا ۖ وَأَحْسِنْ كَمَا أَحْسَنَ اللَّهُ إِلَيْكَ ۖ وَلَا تَبْغِ الْفَسَادَ فِي الْأَرْضِ ۖ إِنَّ اللَّهَ لَا يُحِبُّ الْمُفْسِدِينَ  

{وابتغ} اطلب {فيما آتاك الله} من المال {الدار الآخرة} بأن تنفقه في طاعة الله {ولا تنس} تترك {نصيبك من الدنيا} أي أن تعمل فيها للآخرة {وأحسن} للناس بالصدقة {كما أحسن الله إليك ولا تبغ} تطلب {الفساد في الأرض} بعمل المعاصي {إن الله لا يحب المفسدين} بمعنى أنه يعاقبهم.