Abu Hurairah reported,

The Prophet ﷺ was asked, "Who are the most noble of people?"He replied, "The most noble of them are those most mindful of Allah."They said, "Prophet of Allah, that is not what we are asking about."He said, "Then the most noble of people is Yusuf, prophet of Allah, son of a prophet of Allah, son of a prophet of Allah, son of the intimate friend of Allah."They said, "That is not what we are asking about either."He said, "Are you asking me about the lineages of the Arabs?"They said, "Yes."He said, "The best of you in the days of ignorance are the best of you in Islam, provided they gain understanding of the religion."

Bukhari 3374

Sahih

حدثنا إسحاق بن إبراهيم سمع المعتمر عن عبيد الله عن سعيد بن أبي سعيد المقبري

عن أبي هريرة رضي الله عنه قال

قيل للنبي ﷺ من أكرم الناس قال أكرمهم أتقاهم قالوا يا نبي الله ليس عن هذا نسألك قال فأكرم الناس يوسف نبي الله ابن نبي الله ابن نبي الله ابن خليل الله قالوا ليس عن هذا نسألك قال فعن معادن العرب تسألوني قالوا نعم قال فخياركم في الجاهلية خياركم في الإسلام إذا فقهوا

البخاري 3374صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Hadiths of the prophets
Chapter
Or were you witnesses when death approached Yaqub, to His saying, and we are Muslims submitting to Him
Numbering
Darussalam 3374
Bukhari 3374