It was narrated from Jabir bin Samurah that a man from among the Companions of the Prophet ﷺ was wounded, and the wound caused him a great deal of pain. He went and took a spearhead, and slaughtered himself with it. The Prophet ﷺ did not offer the funeral prayer for him, and that was as an admonition for others.
أَنَّ رَجُلاً مِنْ أَصْحَابِ النَّبِيِّ ﷺ جُرِحَ فَآذَتْهُ الْجِرَاحَةُ فَدَبَّ إِلَى مَشَاقِصِهِ فَذَبَحَ بِهِ نَفْسَهُ فَلَمْ يُصَلِّ عَلَيْهِ النَّبِيُّ ﷺ قَالَ وَكَانَ ذَلِكَ أَدَبًا مِنْهُ