The Messenger of Allah ﷺ said, "How will you fare in a time soon to come, when people will be sifted thoroughly and only the dregs of humanity will remain. Their covenants and trusts will have become tangled, they will fall into discord, and they will become like this," and he interlaced his fingers.They asked, "Messenger of Allah, what should we do when that time comes?"He replied, "Hold fast to what you recognize as good, abandon what you recognize as evil, attend to your own affairs, and leave aside the affairs of the masses."
حدثنا هشام بن عمار ومحمد بن الصباح قالا حدثنا عبد العزيز بن أبي حازم حدثني أبي عن عمارة بن حزم
أن رسول الله ﷺ قال كيف بكم وبزمان يوشك أن يأتي يغربل الناس فيه غربلة وتبقى حثالة من الناس قد مرجت عهودهم وأماناتهم فاختلفوا وكانوا هكذا وشبك بين أصابعه قالوا كيف بنا يا رسول الله إذا كان ذلك قال تأخذون بما تعرفون وتدعون ما تنكرون وتقبلون على خاصتكم وتذرون أمر عوامكم
[Its isnad is hasan]. Abu Dawud narrated it in the Book of Battles, Chapter on Commanding and Forbidding, hadith 4342, from the hadith of Abdul-Aziz through this chain. Hakim declared it sahih, 4/435 and 2/159, as did Dhahabi. This hadith has other paths of transmission, see Nihayah fil-Fitan wal-Malahim, hadith 143, in my edition.