From Imam Ghazali’s Bidayatul Hidayah (The Beginning of Guidance):
Concerning your brethren & friends, you have two tasks: You should first consider the stipulations of companionship and friendship so that you will establish the relationship of brotherhood only with those who are fit for brotherhood & friendship. The Messenger of God (pbuh) said:
“A man is considered by God to be of the religion of his intimate friend (khalil) so let each of you consider whom he has taken for an intimate friend.”
Sayyidina Ali RA said:
Do not be in the company of an ignorant friend;
Beware of him & let him beware of you.
How often an ignorant man has brought estruction
To a forbearing man who has befriended him.
A man is likened with another man
When that man walks with him.
Like the similarity of one shoe to another
When it is set opposite to it.
A thing has patterns and resemblances from other things.
A soul reflects another which it encounters.
2) Good Character
Do not be the companion of a man whose character is bad. He is one who is unable to control himself when he is angry and is excited when he desires something. ‘Alqama al-’Ataridi rahima-hullahu ta’ala gathered together the traits of good character in his will which he gave to his son at the time of his death. He said in that will:
“Dear son, when you want the companionship of a man, be the companion of him who will preserve you when you employ him in your service, will adorn you if you are his companion, and will supply you with victuals when your victuals are not sufficient. Be the companion of him who will extend his helping hand to you when you extend to him your hand for help, will reckon it a good thing if he sees something good proceeding from you, but will stop an evil if he sees it being done by you. Be the companion of a man who will consider you truthful when you speak, will assist you and help you if you desire anything and try for it, and will give you way if you both dispute on any matter.”
*victuals = food or provisions
Do not be the companion of a wicked man (Fasiq) who persists in major sin. This is because he who fears God does not persist in major sin, and he who does not fear God may cause you mischief.
Allah SWT commanded His Prophet (pbuh):
“Do not follow him whose mind We have caused to be neglectful of remembrance of Us and who follows his passions, and whose case exceeds all bounds.” (18:28)
Beware, then of association with a wicked man, because the constant sight of wickedness and sin will remove the dislike of sin from your mind & will create the feeling that sin is something light. The sinfulness of backbiting has become light to man’s mind for this reason and not for the reason that mind cannot understand it. If people see that a Muslim jurist is wearing a gold ring or a silkcloth, they strongly oppose it because they rarely see this, whereas they do not oppose backbiting even though it is a more serious sin, because they always see this.
4) Absence of greed
Companionship of a man greedy for the world is deadly poison, for human nature is such that the nature of one man tends to resemble that of another and to imitate it; indeed, a man’s nature steals the qualities of another man’s nature in such a way that he is not aware of it. Therefore, association with a greedy man will increase your greed, and association with the ascetics will increase your asceticism.
Do not be the companion of a liar, for he is like a mirage: he will show that which is remote near to you and that which is near remote from you.”
Abu Hurairah (may Allah be pleased with him) relates that the Prophet (peace and blessings be upon him) said,
Allah will ask on the Day of Judgment: “Where are those who loved each other for the sake of My glory? Today, on a day when there is no shade but Mine, I shall shade them with My shade.” (Muslim)
Love for Allah’s sake transcends the limits of our worldly existence, enduring into the life to come. Allah says,
[Close friends on that Day will be foes to one another—except for the righteous.] (Az-Zukhruf 43:67)
Both parties must truly love to extend support and assistance to each other and must love good for one another. The Prophet (peace and blessings be upon him) said, “None of you will attain (perfect) faith until he loves for his brother what he loves for himself” (Al-Bukhari and Muslim).
[Surely, the human being is at loss. Except for those who have faith and do righteous deeds and exhort one another to truth and exhort one another to patience.] (Al-`Asr 103:2-3)
[The believing men and women are protecting friends of one another. They enjoin what is right and forbid what is wrong.] (At-Tawbah 9:71)
They must engage in the things that cultivate this love, strengthen interpersonal relationships, and facilitate the fulfilling of their duties to one another.
The love between them shines in a most wonderful and genuine manner when the two are away from each other and each of them is in secret prayers to Allah for the other. This continues for the living one even after the other has departed from the earth.
The Prophet (peace and blessings be upon him) said, “A Muslim’s supplication for his brother in secret is answered. At his head an angel is appointed, and whenever he supplicates for his brother with something good, the angel appointed to him says, ‘Ameen, and likewise for you’” (Muslim).
They must excuse each other’s mistakes and defend each other’s honor, never speaking ill of, or deriding each other. They should keep each other’s secrets, advise each other sincerely, and never abuse each other. The Prophet (peace and blessings be upon him) said, “It is not permissible for one Muslim to distress another” (Abu Dawud).