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

Indeed, those who have divided their religion and become sects - you, ˹O Muhammad˺, are not ˹associated˺ with them in anything. Their affair is only ˹left˺ to Allah; then He will inform them about what they used to do.  

Those who have sundered their religion, by being at variance over it, accepting some ˹aspects˺ of it and rejecting others, and have become differing parties, sects with regard to such ˹matters˺ (a variant reading ˹for farraqū, ‘they have sundered’˺ has fāraqū, meaning that they have abandoned the religion to which they were enjoined, and they are the Jews and the Christians), you have no concern with them at all, in other words, do not be concerned with them. Their case will go to God — He will take charge of it — then He will inform them, in the Hereafter, of what they used to do, and requite them for it: this was abrogated by the ‘sword’ verse ˹Q. 9:5˺.
القرآن:٦:١٥٩

إِنَّ الَّذِينَ فَرَّقُوا دِينَهُمْ وَكَانُوا شِيَعًا لَسْتَ مِنْهُمْ فِي شَيْءٍ ۚ إِنَّمَا أَمْرُهُمْ إِلَى اللَّهِ ثُمَّ يُنَبِّئُهُمْ بِمَا كَانُوا يَفْعَلُونَ  

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