Allah, the All-Wise also says:
"Friends on that Day will be enemies one to another, except al-Muttaqoon (i.e. those who have Taqwah)." [43:67]
Hafidh Ibn Katheer, commenting on this verse, relates a story on the authority of Ali Ibn Abi Talib (r.a.a.) and says that any friendship for other than Allah is turned into enmity, except what was in it for Allah the Mighty and Majestic: Two who are friends for Allah's sake; one of them dies and is given good news that he will be granted al-Jannah, so he remembered his friend and he supplicated for him, saying: O Allah, my friend used to command me to obey You and to obey Your Prophet (s.a.w.) and used to command me to do good and to forbid me from doing evil. And he told me that I will meet You. O Allah, do not let him go astray after me, until you show him what you have just shown me, until You are satisfied with him, just like You are satisfied with me." So he is told: "Had you known what is (written) for you friend, would you have laughed a lot and cried a little." Then his friend dies and their souls are gathered, and both are asked to express their opinions about each other. So each one of them says to his friend: you were the best brother, the best companion and the best friend." And when on of the two disbelieving friends dies, and he is given tidings of Hellfire, he remembered his friend and he said: O Allah, my friend used to order me to disobey You and disobey Your Prophet, and commanded me to do evil, and forbade me from doing good, and told me that I would not meet You. O Allah, do not guide him after me, until you show him what you have just shown me and until you are dissatisfied with him just like You are dissatisfied with me." Then the other disbelieving friend dies, and their souls are gathered, and both are asked to give their opinions about each other. So each one says to his friend: you were the worst brother, the worst companion and the worst friend."
That is the end of those who do not have Taqwah and those who befriend for a sake other than that of Allah the Exalted. Allah has surely spoken the truth and we all should grasp what He has informed us of. It is through the good company that Allah, the Most High, saves those who are astray and guides the wicked. The benefit of mixing with the righteous is immense, and it will, insha'allah, be even more obvious to us in the Hereafter. One of the early Muslims said that it is from Allah's blessings upon a youth when he turns to worship that he is given brother who is a follower of the Sunnah encouraging him upon it".
Sealing a friendship for Allah's sake will result in one's receiving protection of Allah (s.w.t.). And as Ibn Abbas said: "No one may taste true faith except by this (i.e. building relationships for Allah's sake), even if his prayers and fasts are many. People have come to build their relationship around the concerns of the world, but it will not benefit them in any way." A scholar has said: "To seal a friendship for Allah's sake indicates the obligation of establishing relationships of love and trust for His sake; this is a friendship for the sake of Allah. It also indicates that simple affection is not enough here; indeed what is meant is a love based upon alliance. This entails assistance, honour, and respect. It means being with those whom you love both in word and deed." Loyalty for the sake of Allah really means to love Allah and to come to the assistance of His Deen; to love those who are obedient to Him and to come to their help. Moreover, the Shahadah "La Ilaha Illa Allah" requires us to ally ourselves for the sake of Allah, and it requires us to ally ourselves to the Muslims wherever we find them.
In two other authentic narrations of the Prophet (s.a.w.) we were commanded to keep company with a believer only(3), and told that a person will be with those he loves(4). So if we love and associate ourselves with those who are misguided, we should fear for our fate. The wise person is the one who prepares himself for the Hereafter, not the one who neglects his faith and falls into the trap of Satan who tells him that he will be forgiven and that he can do whatever he wishes. If we truly believe that the best speech is the Speech of Allah and that he best guidance is the guidance of Prophet Muhammad (s.a.w.), we should act in accordance with them, lest we build a proof against ourselves. Ali (r.a.a.) said: "Mix with the noble people, you become one of them; and keep away from evil people to protect yourself from their evils." If we are truly concerned about our fate, we must come to this realisation: those who take us away from remembering Allah, from obeying Him and His Prophet (s.a.w.), those who fail to remind us of our daily prayers and those who do not give us sincere advice in regard to our Deen; such are really our foes and not our friends.
On the other side, a believer is the mirror of his brother"(5), and if he sees any faults in the other believer, he draws his attention to it, helps him to give it up and helps him wipe away any evil that he may have. Ibn Hazm said: Anyone who criticises you cares about your friendship. Anyone who makes light of your faults cares nothing about you."
How can we expect sincere advice and exhortation in regard to our religion from those who are displeased with our Deen or are simply indifferent? Are they going to help us achieve the purpose of our life, or will they take us away from it? Will they desire for us Allah's pleasure or is that Completely irrelevant to them and not their concern at all? Are they leading us to al-Jannah or to the Hellfire? These are the questions we have to ask ourselves, lest we wake up after we die.
"O you who believe! Take care of your own selves. If you follow the right guidance and enjoin what is right and forbid what is wrong no hurt can come to you from those who are in error. The return of you all is to Allah, then He will inform you about (all) that which you used to do." [5:105]
We ask Allah to make us of the righteous ones and give us companions that will take us away from His Wrath and lead us to His Pleasure and Paradise.