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:3:103

And hold firmly to the rope of Allah all together and do not become divided. And remember the favor of Allah upon you - when you were enemies and He brought your hearts together and you became, by His favor, brothers. And you were on the edge of a pit of the Fire, and He saved you from it. Thus does Allah make clear to you His verses that you may be guided.  

And hold fast to, clutch, God’s bond, namely, His religion, together, and do not scatter, after submitting ˹to Islam˺; remember God’s grace, His bestowing of favours, upon you, O companies of the Aws and the Khazraj, when you were enemies, and He brought your hearts together, through Islam, so that by His grace you became brothers, in religion and comradeship; and you were upon the brink, the edge, of a pit of fire, such that to fall into it you only had to die disbelieving; but He delivered you from it, through belief. So, just as He has made clear for you what has been mentioned, God makes clear to you His signs that you might be guided.
القرآن:٣:١٠٣

وَاعْتَصِمُوا بِحَبْلِ اللَّهِ جَمِيعًا وَلَا تَفَرَّقُوا ۚ وَاذْكُرُوا نِعْمَتَ اللَّهِ عَلَيْكُمْ إِذْ كُنْتُمْ أَعْدَاءً فَأَلَّفَ بَيْنَ قُلُوبِكُمْ فَأَصْبَحْتُمْ بِنِعْمَتِهِ إِخْوَانًا وَكُنْتُمْ عَلَىٰ شَفَا حُفْرَةٍ مِنَ النَّارِ فَأَنْقَذَكُمْ مِنْهَا ۗ كَذَٰلِكَ يُبَيِّنُ اللَّهُ لَكُمْ آيَاتِهِ لَعَلَّكُمْ تَهْتَدُونَ  

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