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

Whoever should think that Allah will not support ˹Prophet Muhammad˺ in this world and the Hereafter - let him extend a rope to the ceiling, then cut off ˹his breath˺, and let him see: will his effort remove that which enrages ˹him˺?  

Whoever supposes that God will not help him, namely, Muhammad (s) His Prophet, in this world and the Hereafter, let him extend a rope to the ceiling, ˹to˺ the roof of his house, fixing it there and ˹tying it˺ to his neck, and let him hang himself, that is, let him choke to death because of it, by severing his soul from ˹any existence on˺ the earth, as ˹reported˺ in the ˹various˺ Sahīh compilations. Then let him see whether his strategy, against the Prophet being helped, dispels that which enrages him, about it. In other words, let him choke to death with rage because of it, for it is inevitable.
القرآن:٢٢:١٥

مَنْ كَانَ يَظُنُّ أَنْ لَنْ يَنْصُرَهُ اللَّهُ فِي الدُّنْيَا وَالْآخِرَةِ فَلْيَمْدُدْ بِسَبَبٍ إِلَى السَّمَاءِ ثُمَّ لْيَقْطَعْ فَلْيَنْظُرْ هَلْ يُذْهِبَنَّ كَيْدُهُ مَا يَغِيظُ  

{من كان يظن أن لن ينصره الله} أي محمدا نبيه {في الدنيا والآخرة فليمدد بسبب} بحبل {إلى السماء} أي سقف بيته يشدّه فيه وفي عنقه {ثم ليقطع} أي ليختنق به بأن يقطع نفسه من الأرض كما في الصحاح {فلينظر هل يُذهبن كيده} في عدم نصرة النبي {ما يغيظ} منها المعنى فليختنق غيظا منها فلا بد منها.