Narrated Anas bin Malik: A man asked the Prophet (ﷺ) "When will the Hour be established O Allah's Messenger?" The Prophet (ﷺ) . said, "What have you prepared for it?" The man said, " I haven't prepared for it much of prayers or fast or alms, but I love Allah and His Apostle." The Prophet (ﷺ) said, "You will be with those whom you love."
Source: sunnah.com
Other translations
Arabic
حَدَّثَنَا عَبْدَانُ، أَخْبَرَنَا أَبِي، عَنْ شُعْبَةَ، عَنْ عَمْرِو بْنِ مُرَّةَ، عَنْ سَالِمِ بْنِ أَبِي الْجَعْدِ، عَنْ أَنَسِ بْنِ مَالِكٍ، أَنَّ رَجُلاً، سَأَلَ النَّبِيَّ صلى الله عليه وسلم مَتَّى السَّاعَةُ يَا رَسُولَ اللَّهِ قَالَ " مَا أَعْدَدْتَ لَهَا ". قَالَ مَا أَعْدَدْتُ لَهَا مِنْ كَثِيرِ صَلاَةٍ وَلاَ صَوْمٍ وَلاَ صَدَقَةٍ، وَلَكِنِّي أُحِبُّ اللَّهَ وَرَسُولَهُ. قَالَ " أَنْتَ مَعَ مَنْ أَحْبَبْتَ ".
sunnah.com