Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
abudawud:5127And Hb b. Baqiyyah > Khālid > Yūnus b. ʿUbayd > Thābit > Anas b. Mālik

I never saw the Companions of the Messenger of Allah (May peace be upon him) so happy about anything as I saw them happy about this thing. A man said : Messenger of Allah! A man loves another man for the good work which he does, but he himself cannot do like it. The Messenger of Allah (May peace be upon him) said: A man will be with those whom he loves.  

أبو داود:٥١٢٧حَدَّثَنَا وَهْبُ بْنُ بَقِيَّةَ حَدَّثَنَا خَالِدٌ عَنْ يُونُسَ بْنِ عُبَيْدٍ عَنْ ثَابِتٍ عَنْ أَنَسِ بْنِ مَالِكٍ قَالَ

رَأَيْتُ أَصْحَابَ رَسُولِ اللَّهِ ﷺ فَرِحُوا بِشَىْءٍ لَمْ أَرَهُمْ فَرِحُوا بِشَىْءٍ أَشَدَّ مِنْهُ قَالَ رَجُلٌ يَا رَسُولَ اللَّهِ الرَّجُلُ يُحِبُّ الرَّجُلَ عَلَى الْعَمَلِ مِنَ الْخَيْرِ يَعْمَلُ بِهِ وَلاَ يَعْمَلُ بِمِثْلِهِ فَقَالَ رَسُولُ اللَّهِ ﷺ الْمَرْءُ مَعَ مَنْ أَحَبَّ