Keep away from all those different sects
Hudhayfah bin Al-Yaman, may Allah be pleased with him, narrated:
The people used to ask Allah's Messenger may the peace and blessings of Allah be upon him, about good, but I used to ask him about evil for fear that it might overtake me. Once I said, "O Allah's Messenger We were in ignorance and in evil and Allah has bestowed upon us the present good; will there by any evil after this good?" He may the peace and blessings of Allah be upon him, said, "Yes." I asked, "Will there be good after that evil?" He said, "Yes, but it would be tainted with Dakhan (i.e. Little evil)." I asked, "What will its Dakhan be?" He said, "There will be some people who will lead (people) according to principles other than my tradition. You will see their actions and disapprove of them." I said, "Will there be any evil after that good?" He said, "Yes, there will be some people who will invite others to the doors of Hell, and whoever accepts their invitation to it will be thrown in it (by them)." I said, "O Allah's Messenger Describe those people to us." He may the peace and blessings of Allah be upon him, said, "They will belong to us and speak our language" I asked, "What do you order me to do if such a thing should take place in my life?" He said, "Adhere to the group of Muslims and their Chief." I asked, "If there is neither a group (of Muslims) nor a chief (what shall I do)?" He said, "Keep away from all those different sects, even if you had to bite on the root of a tree, till you meet Allah while you are still in that state."
Hudhayfah narrated that he was asking the Prophet, may the peace and blessings of Allah be upon him, about evil, while people were asking him about good, fearing that he would be disturbed by it, or that he could not ward it off if evil befalls him. Once one is aware of evil he would prepare for confronting it properly as well as to prevent the causes leading to it.
The wise is he who gets to know the evil not for evil purposes, but to ward it off and to take the precautions lest he would be afflicted.
Getting to know the evil takes precedence over knowing the good, because warding off the harm takes precedence over bringing the interests as the scholars of Usool say.
After Hudhayfah, may Allah be pleased with him, knew that, he continued his talk with the Messenger of Allah, may the peace and blessings of Allah be upon him, with a question that he had to present to the Messenger of since it was the purpose of all the previous questions.
He said: O Messenger of Allah, what do you see - and in another narration: What do you order me to do if such a thing should take place in my life?
The Messenger of Allah, may the peace and blessings of Allah be upon him, replied: Adhere to the group of Muslims and their Chief.
That is: to adhere to the right approach and the noble behaviors of the believers, and to follow their approach in terms of worship and transactions and all other branches of Islam.
The Muslim community: They are those who knew Islam from its original sources, and worked as stated in the Quran and Sunnah at a time when Islam is strange as it began.
They are a group that one hardly knows because they are few, like those who will be between Mecca and Medina, as stated in Sahih Muslim and others on the authority of Ibn Umar - may Allah be pleased with them - that the Messenger of Allah may the peace and blessings be upon him said: "Islam began strange and will return strange. it recedes between the two mosques just as the serpent crawls back into its hole. "
the chief of the Muslims on that day: is the most knowledgeable among them who took the authority with the Muslims` authorization.