(50) باب الْمَرْءُ مَعَ مَنْ أَحَبَّ
Anas b. Malik reported:
Allah's Messenger (ﷺ) and I were coming out of the mosque that we met a person on the threshold of the mosque and he said to Allah's Messenger (ﷺ): When would be the Last Hour? Allah's Messenger (ﷺ) said: What preparation have you made for that? The man became silent and then said: Allah's Messenger, I have made no significant preparation with prayer and fasting and charity but I, however, love Allah and His Messenger. Thereupon (the Holy Prophet) said: You would be along with one whom you love.
Reference: Sahih Muslim 2639 f
In-book reference: Book 45, Hadith 210
USC-MSA web (English) reference(deprecated numbering scheme): Book 32, Hadith 6382