Reference: Declared hasan by Shaykh al-Albaanee in Silsilah al-Ahaadeeth as-Saheehah by virtue of all its different chains of narration.
On the authority of Ibn ‘Umar (radhi-yAllaahu ‘anhumaa) who said:
I was with the Messenger of Allaah (sal-Allaahu ‘alayhi wa sallam) when a man from the Ansaar came up to the Messenger of Allaah (sal-Allaahu ‘alayhi wa sallam) and greeted him with the salaam and then said: O Messenger of Allaah (sal-Allaahu ‘alayhi wa sallam) which of the believers are the best?
He replied:
Those who are best in character.
Then he asked: Which of the believers are the most intelligent?
He replied:
Those who remember death the most, and those who are best prepared for what comes after it. These are the intelligent ones.