The Book of Virtue, Enjoining Good Manners, and Joining of the Ties of Kinship
Ṣaḥīḥ Muslim 6709
النَّاسُ مَعَادِنُ كَمَعَادِنِ الْفِضَّةِ وَالذَّهَبِ خِيَارُهُمْ فِي الْجَاهِلِيَّةِ خِيَارُهُمْ فِي الإِسْلاَمِ إِذَا فَقُهُوا وَالأَرْوَاحُ جُنُودٌ مُجَنَّدَةٌ فَمَا تَعَارَفَ مِنْهَا ائْتَلَفَ وَمَا تَنَاكَرَ مِنْهَا اخْتَلَفَ
an-nāsu maʿādinu kamaʿādini al-fiḍḍah wa-adh-dhahabi khiyāruhum fī al-jāhiliyyah khiyāruhum fī al-islāmi idhā faquhūā wa-l-arwāḥu junūdun mujannadatun famā taʿārafa minhā āʾtalafa wamā tanākara minhā ākhtalafa
Transliteration generated from the Arabic vowel marks
The full narration
Abu Huraira narrated directly from Allah's Messenger (ﷺ) that he said:People are like mines of gold and silver; those who were excellent in Jahiliya (during the days of ignorance) are excellent In Islam, when they have, an understanding, and the souls are troops collected together and those who had a mutual familiarity amongst themselves in the store of prenatal existence would have affinity amongst them, (in this world also) and those who opposed one of them, would be at variance with one another
Source
Ṣaḥīḥ Muslim · 6709