It is narrated from Sayyiduna Ibn Abbas (may Allah be pleased with them both) that the Noble Prophet (peace and blessings be upon him) passed by some people who were sitting. He (peace be upon him) said: "Shall I not tell you about the person who is the best in the sight of Allah Almighty?" They replied: "Please do tell us." He said: "The person who sets out with his horse in the path of Allah (i.e., for jihad) until he dies or is martyred." Then he (peace be upon him) said: "Shall I tell you about the one who is closest to him in deeds?" They replied: "O Messenger of Allah (peace be upon him), please do tell us." He said: "Then it is the person who separates himself from people, worships (performs prayer) in a mountain pass, gives zakat, and keeps away from the mischief and evil of people. And shall I not tell you who is the worst of all?" We said: "Please tell us." He said: "The person who, when asked in the name of Allah Almighty, does not give anything (he is the worst person)." In some narrations, it is mentioned: "The person who is asked in the name of Allah and nothing is given to him."
From this hadith, it is understood that the most virtuous person is the one who sets out for jihad in the path of Allah and passes away or is martyred.
Next to him, the best person is the one who, during times of tribulation, leaves the cities and villages to avoid evils, and there adheres to the commands of Allah, the observance of prayer (salah), zakat, and other obligations.
And the worst person is the one from whom something is asked in the name of Allah, yet he withholds his hand and does not spend anything.