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:18:104

˹They are˺ those whose effort is lost in worldly life, while they think that they are doing well in work."  

Those whose effort goes astray in the life of this world, ˹those˺ whose deeds are invalid, while they reckon, they think, that they are doing good work, ˹good˺ deeds for which they will be rewarded.
القرآن:١٨:١٠٤

الَّذِينَ ضَلَّ سَعْيُهُمْ فِي الْحَيَاةِ الدُّنْيَا وَهُمْ يَحْسَبُونَ أَنَّهُمْ يُحْسِنُونَ صُنْعًا  

{الذين ضل سعيهم في الحياة الدنيا} بطل عملهم {وهم يحسبون} يظنون {أنهم يحسنون صنعا} عملاً يجازون عليه.