Sahih Muslim Book 032, Hadith Number 6379.
Chapter : A person would be along with him whom he loves.
Anas reported that a person said to Allah's Messenger (may peace be upon him): When would be the Last Hour? He (the Holy Prophet) said: What preparation have you made for that? And he gave no details, but said: I love Allah and His Messenger. Thereupon he (the Holy Prophet) said: You would be along with one whom you love. Anas b. Malik reported through another chain of transmitters that a desert Arab came to Allah's Messenger (may peace be upon, him), the rest of the hadith is the same but with this variation that he said: I have not made much preparations which merit appreciation for myself.