As-Salaam alaikum,
The Noble Messenger of Allah, Sallallahu alaihi Wasallam, was asked :- "Which of the believers are the most intelligent?"
He, Sallallahu alaihi Wasallam, replied :-
"Those who remember death the most, and are best prepared for what comes after it. Those are the intelligent ones."
(Reported by Tabarani, Ibn Majah, classed as Hassan).