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

Then perhaps you would kill yourself through grief over them, ˹O Muhammad˺, if they do not believe in this message, ˹and˺ out of sorrow.  

Yet it may be that you will consume, destroy, yourself in their wake — following ˹your being with˺ them, that is, after they have left you — if they should not believe in this discourse, ˹in this˺ Qur’ān, out of grief, out of rage and anguish on your part, because of your eagerness that they believe (asafan, ‘out of grief’, is in the accusative because it functions as an object denoting reason).
القرآن:١٨:٦

فَلَعَلَّكَ بَاخِعٌ نَفْسَكَ عَلَىٰ آثَارِهِمْ إِنْ لَمْ يُؤْمِنُوا بِهَٰذَا الْحَدِيثِ أَسَفًا  

{فلعلك باخع} مهلك {نفسك على آثارهم} بعدهم أي بعد توليهم عنك {إن لم يؤمنوا بهذا الحديث} القرآن {أسفا} غيظا وحزنا منك لحرصك على إيمانهم، ونصبه على المفعول له.