The Messenger of Allah ﷺ said, "How will you fare in a time, or a time is about to come, when people will be sifted through such that only the dregs of humanity remain. Their covenants and trusts will have become corrupted, and they will fall into discord, becoming like this," and he interlaced his fingers.They asked, "What should we do then, Messenger of Allah?"He replied, "Hold on to what you recognize as good, leave what you find objectionable, attend to your own private affairs, and leave aside the affairs of the masses."
حدثنا القعنبي أن عبد العزيز بن أبي حازم حدثهم عن أبيه عن عمارة بن عمرو
أن رسول الله ﷺ قال كيف بكم وبزمان أو يوشك أن يأتي زمان يغربل الناس فيه غربلة تبقى حثالة من الناس قد مرجت عهودهم وأماناتهم واختلفوا فكانوا هكذا وشبك بين أصابعه فقالوا وكيف بنا يا رسول الله قال تأخذون ما تعرفون وتذرون ما تنكرون وتقبلون على أمر خاصتكم وتذرون أمر عامتكم
Sourcing, its isnad is hasan. Ibn Majah narrated it in "The Book of Tribulations," chapter "Exercising caution during tribulation," hadith 3957, from the hadith of Abdul-Aziz bin Abu Hazim, through the same chain, and Hakim graded it sahih in 2/159, 4/435, and Dhahabi agreed with him.