Abu Hurairah (May Allah be pleased with him) reported:
It was asked, "O Messenger of Allah! Who is the most honourable amongst mankind?" He (ﷺ) said, "The most honourable of them is one who is the most pious of them." They said, "We are not asking about this". He said, "Then, the most honourable of men was Yusuf (Joseph), the Prophet of Allah, the son of Allah's Prophet, who was the son of the Prophet of Allah, who was the son of the Khalil of Allah (i.e., Ibrahim (ﷺ))' They said, "We are not asking you about this." He enquired, "Are you then asking me about the classes of the Arabs? The best of them in the Pre- Islamic Period of Ignorance are the best of them in Islam, provided they comprehend the religious knowledge".[Al-Bukhari and Muslim].
Arabic/English book reference: Book 1, Hadith 69