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:15:84

So nothing availed them ˹from˺ what they used to earn.  

And so that which they used to count as gain, in the way of building fortresses and amassing riches, did not avail, ˹did not˺ protect, them, from the chastisement.
القرآن:١٥:٨٤

فَمَا أَغْنَىٰ عَنْهُمْ مَا كَانُوا يَكْسِبُونَ  

{فما أغنى} دفع {عنهم} العذاب {ما كانوا يكسبون} من بناء الحصون وجمع الأموال.

See similar narrations below:

Collected by Qurʾān
quran:26:207

They would not be availed by the enjoyment with which they were provided.  

in what way (mā here is interrogative) would that enjoyment which they were given avail them?, in averting the chastisement or mitigating it? It would be of no avail!
القرآن:٢٦:٢٠٧

مَا أَغْنَىٰ عَنْهُمْ مَا كَانُوا يُمَتَّعُونَ  

{ما} إستفهامية بمعنى: أي شيء {أغنى عنهم ما كانوا يمتعون} في دفع العذاب أو تخفيفه أي: لم يغن.
quran:39:50

Those before them had already said it, but they were not availed by what they used to earn.  

Already the same was said by those who were before them, of communities, such as Korah and those of his people who were content with such ˹a saying˺. But what they used to earn did not avail them.
القرآن:٣٩:٥٠

قَدْ قَالَهَا الَّذِينَ مِنْ قَبْلِهِمْ فَمَا أَغْنَىٰ عَنْهُمْ مَا كَانُوا يَكْسِبُونَ  

{قد قالها الذين من قبلهم} من الأمم كقارون وقومه الراضين بها {فما أغنى عنهم ما كانوا يكسبون}.
quran:111:2

His wealth will not avail him or that which he gained.  

His wealth will not avail him, nor what he has earned (wa-kasab means wa-kasbihi, that is to say, his sons; mā aghnā means ˹mā˺ yughnī).
القرآن:١١١:٢

مَا أَغْنَىٰ عَنْهُ مَالُهُ وَمَا كَسَبَ  

{ما أَغنى عنه ماله وما كسب} أي وكسبه، أي ولده ما أغنى بمعنى يغني.