Huzaifa bin Yaman reported,

People used to ask the Messenger of Allah ﷺ about the good, but I used to ask him about the evil, fearing it might overtake me.I said, "Messenger of Allah, we were living in ignorance and evil, then Allah brought us this good. Will there be any evil after this good?"He said, "Yes."I asked, "And will there be any good after that evil?"He said, "Yes, but it will be tainted."I asked, "What will taint it?"He said, "A people who guide by other than my guidance. You will recognize some of what they do and reject some of it."I asked, "Will there be any evil after that good?"He said, "Yes, callers at the gates of Hell. Whoever responds to them will be cast into it."I said, "Messenger of Allah, describe them to us."He said, "They will be from our own people and will speak our language."I asked, "What do you command me to do if I live to see that?"He said, "Hold fast to the main body of the Muslims and their leader."I asked, "What if they have no main body and no leader?"He said, "Then withdraw from all those factions, even if you must bite onto the root of a tree until death overtakes you in that state."

Bukhari 7084

Sahih

حدثنا محمد بن المثنى حدثنا الوليد بن مسلم حدثنا ابن جابر حدثني بسر بن عبيد الله الحضرمي أنه سمع أبا إدريس الخولاني أنه سمع

حذيفة بن اليمان يقول

كان الناس يسألون رسول الله ﷺ عن الخير وكنت أسأله عن الشر مخافة أن يدركني فقلت يا رسول الله إنا كنا في جاهلية وشر فجاءنا الله بهذا الخير فهل بعد هذا الخير من شر قال نعم قلت وهل بعد ذلك الشر من خير قال نعم وفيه دخن قلت وما دخنه قال قوم يهدون بغير هديي تعرف منهم وتنكر قلت فهل بعد ذلك الخير من شر قال نعم دعاة على أبواب جهنم من أجابهم إليها قذفوه فيها قلت يا رسول الله صفهم لنا قال هم من جلدتنا ويتكلمون بألسنتنا قلت فما تأمرني إن أدركني ذلك قال تلزم جماعة المسلمين وإمامهم قلت فإن لم يكن لهم جماعة ولا إمام قال فاعتزل تلك الفرق كلها ولو أن تعض بأصل شجرة حتى يدركك الموت وأنت على ذلك

البخاري 7084صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Tribulations
Chapter
How matters stand when there is no community
Numbering
Darussalam 7084
Bukhari 7084