Allah Almighty says: {So flee to Allah. Indeed, I am a clear warner to you from Him.} [Adh-Dhāriyāt: 50]
A believer who associates with people and patiently endures their harm is better than a believer who does not associate with people and does not patiently endure their harm. But sometimes things happen that make seclusion better than associating with people, like when there are times of trials and temptations.
597/1 - Sa‘d ibn Abi Waqqās (may Allah be pleased with him) reported: I heard the Prophet (may Allah’s peace and blessings be upon him) say: “Verily, Allah loves the servant who is pious, rich (free of wants), and inconspicuous.” [Narrated by Muslim]
"Rich" here means content and free of wants, as previously explained in the authentic Hadīth.
1) It points out the merit of being secluded from people and committing oneself to worship of Allah when one fears temptation and people are corrupt.
2) It affirms the attribute of love in Allah Almighty, as He loves His obedient servants. So, let everyone be diligent in doing such things that win him the love of his Lord.
3) The best of actions are those done secretly to avoid showing-off, unless doing an action openly serves a good purpose.
598/2 - Abu Sa‘īd al-Khudri (may Allah be pleased with him) reported that a man said: “O Messenger of Allah, who is the best among people?” He said: “A believer who strives in the cause of Allah with his life and wealth.” He said: “Then who?” He said: “A man who retires to a narrow valley to worship his Lord.”
In another version: “A man who fears Allah and spares people his own evil.” [Narrated by Al-Bukhāri and Muslim]
--
1) One of the best things to do when there are many trials is to keep away from people, since this makes a person safe from people and makes them safe from him.
2) For such retirement to be Shariah-compliant and commendable, it should be devoted to worshiping Allah. A person should not hide from people and engage in sins.
599/3 - He also reported that the Prophet (may Allah’s peace and blessings be upon him) said: “A time will soon come when the best property of a Muslim will be sheep which he will take to the top of mountains and the places of rainfall, fleeing with his religion from trials.” [Narrated by Al-Bukhāri]
--
The places of rainfall: the places of grass where rain falls.
1) It is the way of the believers to flee temptations, for this protects their religious and worldly affairs.
2) Solitude gives one relief from evil companions.
3) When trials are rife, the company of animals becomes better than that of wicked people!
600/4 - Abu Hurayrah (may Allah be pleased with him) reported that the Prophet (may Allah’s peace and blessings be upon him) said: “Every prophet that Allah sent tended sheep.” He was asked: “And did you?” He replied: “Yes, I tended them for the Makkans in return for some money.” [Narrated by Al-Bukhāri]
--
1) Tending sheep accustoms the shepherd to turning to what is good, like good pastures for example. Likewise, anyone who is responsible for tending to people’s religious or worldly affairs should guide them to what serves their interests and forbid them from what is harmful to them.
2) All the prophets were shepherds of sheep, because shepherding sheep in particular makes the shepherd calm and composed. Sheep are weaker than other animals and they can be subdued more readily. These are lessons to be learned from the prophets’ guidance.
3) It is better for a person to work in lawful professions, even sheep herding, than to engage in any unlawful work.
601/5 - He also reported that the Prophet (may Allah’s peace and blessings be upon him) said: “Of the people who live the best kind of life is the man who holds the reins of his horse (ever ready to march) in the way of Allah, flies on its back whenever he hears the war cry; he flies to it seeking to be killed or to face death at places where it is expected. Or a man who lives with a few sheep at a hill-top or in a valley, performs prayer regularly, gives alms, and worships his Lord until death comes to him. He does not mix with people except in what is good.” [Narrated by Muslim]
Flies: rushes, hastens. -- -- -- -- --
--
--
1) It is good to seclude oneself from people, unless this prevents one from performing the Islamic duties in the proper way.
2) A person should keep away from people whose company causes sickness in the heart, like those who are defiantly disobedient to Allah or followers of religious innovations. As for those whose company nurtures the heart, like the pious, the people of knowledge, and the followers of the Sunnah, a person should be keen to accompany them and love them.