Sayyiduna Abdullah (may Allah be pleased with him) narrates from the Prophet (peace and blessings be upon him) that he said: "(On the Day of Resurrection) a person will be with whom he loves." Muslim ibn Hajjaj narrated it from Uthman ibn Abi Shaybah and Ishaq ibn Ibrahim; Ishaq said: "Akhbarana," and Uthman said: "Haddathana Jarir." (Further, Jarir) narrated from A'mash with his chain in a similar manner.
Explanation: The meaning is that if a person in this world has such a degree of attachment to someone that his love for that person prevails over all other loves, then on the Day of Resurrection he will be with the one whom he loved in the world. There are two narrations in the background of this hadith:
① Sayyiduna Abdullah ibn Mas'ud radi Allahu anhu reports that a man came to the Messenger of Allah sallallahu alayhi wa sallam and said: "O Messenger of Allah! What do you say about a person who loves a group of people but has not been able to join them?" The Prophet sallallahu alayhi wa sallam replied: "A person will be with those whom he loves." [بخاري : 6169]
② Sayyiduna Anas radi Allahu anhu reports that a man asked the Prophet sallallahu alayhi wa sallam: "O Messenger of Allah! When will the Hour (Day of Resurrection) come?" The Prophet sallallahu alayhi wa sallam replied: "What have you prepared for it?" He said: "I have not prepared for it many prayers, fasts, or charities, but I love Allah and His Messenger (sallallahu alayhi wa sallam)." The Prophet sallallahu alayhi wa sallam said: "You will be with those whom you love." [بخاري : 6171]
Sayyiduna Anas radi Allahu anhu says: "After accepting Islam, I have never seen the Muslims rejoice at anything more than this, and he says: I love Allah, His Messenger, and Sayyiduna Abu Bakr and Umar radi Allahu anhum, and I hope that I will be with them, even though I have not performed deeds like theirs." [مسلم : 3639]
We also supplicate to Allah Ta'ala to instill in us love for Himself, His Messenger, all the noble Companions, and the friends of Allah, and to gather us with them. Ameen.