Hadith 5008
وَعَنِ ابْنِ مَسْعُودٍ قَالَ: جَاءَ رَجُلٌ إِلَى النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ فَقَالَ: يَا رَسُولَ اللَّهِ كَيْفَ تَقُولُ فِي رَجُلٍ أَحَبَّ قَوْمًا وَلَمْ يَلْحَقْ بِهِمْ؟ فَقَالَ: «المرءُ معَ من أحب» . مُتَّفق عَلَيْهِ
Ibn Mas'ud (may Allah be pleased with him) narrates: A man came to the Prophet (peace and blessings of Allah be upon him) and said, "O Messenger of Allah! What do you say about a person who loves some people but has not joined them (in companionship or in knowledge and deeds)?" The Prophet (peace and blessings of Allah be upon him) said: "A person will be with those whom he loves." Agreed upon.