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:42:48

But if they turn away - then We have not sent you, ˹O Muhammad˺, over them as a guardian; upon you is only ˹the duty of˺ notification. And indeed, when We let man taste mercy from us, he rejoices in it; but if evil afflicts him for what his hands have put forth, then indeed, man is ungrateful.  

But if they are disregardful, of answering ˹God˺, We have not sent you as a keeper over them, to keep ˹track of˺ their deeds by securing what is demanded of them. Your duty is only to deliver the Message — this was ˹revealed˺ before the command to struggle ˹against them˺. And indeed when We let man taste from Us some mercy, some grace, such as wealth and good health, he exults in it; but if some ill, ˹some˺ calamity, befalls them (the pronoun here refers to ‘man’, on the basis of the ˹plural import of the˺ generic noun) because of what their ˹own˺ hands have sent ahead, ˹because of what˺ they have offered ˹of deeds˺ — the expression refers to ‘the hands’ because most actions are effected by them), then lo! man is ungrateful, for the grace.
القرآن:٤٢:٤٨

فَإِنْ أَعْرَضُوا فَمَا أَرْسَلْنَاكَ عَلَيْهِمْ حَفِيظًا ۖ إِنْ عَلَيْكَ إِلَّا الْبَلَاغُ ۗ وَإِنَّا إِذَا أَذَقْنَا الْإِنْسَانَ مِنَّا رَحْمَةً فَرِحَ بِهَا ۖ وَإِنْ تُصِبْهُمْ سَيِّئَةٌ بِمَا قَدَّمَتْ أَيْدِيهِمْ فَإِنَّ الْإِنْسَانَ كَفُورٌ  

{فإن أعرضوا} عن الإجابة {فما أرسلناك عليهم حفيظاً} تحفظ أعمالهم بأن توافق المطلوب منهم {إن} ما {عليك إلا البلاغ} وهذا قبل الأمر بالجهاد {وإنا إذا أذقنا الإنسان منا رحمة} نعمة كالغنى والصحة {فرح وإن تصبهم} الضمير فلإنسان باعتبار الجنس {سيئة} بلاء {بما قدمت أيديهم} أي قدموه وعبر بالأيدي لأن أكثر الأفعال تزاول بها {فإن الإنسان كفور} للنعمة.