Friends have a large influence on our lives. Islam has emphasized on choosing companions who are upright and noble. The Prophet (peace be upon him said), “Man is on his friend’s religion. Therefore, man should see with whom he is making friends.” (Abu Dawood, no.4815).
Friendship that leads one to Allah’s disobedience is not worth it. Ibn Qudamah Al-Maqdisi mentions in his book Mukhtasar Minhaj Al-Qasidin (pg. 126-132) some valuable points on this topic:
Know that not everyone is suitable to be your friend. You must verify that this potential friend has the necessary characteristics that make friendship with him something to be desired. The one you seek to befriend must have five characteristics:
• He must be intelligent, as there is no good in befriending an idiot, as he will only harm you when he wants to benefit you. By intelligent, we mean one who understands things as they are, either on his own, or if they are explained to him.
• He must have good manners, and this is a must. One who is simply intelligent might be overcome by anger or desire, and obey his desire. Thus, there would be no benefit in befriending him.
• He must not be a fasiq, the one who openly disobeys Allah, as such a person would not fear Allah, and whoever does not fear Allah cannot be trusted.
• He must not be an innovator, as his over-indulgence innovation is feared from befriending him.
• He should not be too eager in seeking the dunya. Which means that he is not willing to sacrifice his hereafter for it.