The Quran is the guidance for the Muslims throughout their life. So of course, it covers all the things related to the real life. The friendship is a very important part of the human life and the divine Quran has not failed to recognize it.
Allah Almighty says in the Noble Quran, “And (remember) the day when the unjust one shall bite his hands saying: O! Would that I had taken a way with the Messenger! O woe is me! Would that I had not taken such a one for a friend! Certainly he led me astray from the reminder after it had come to me;” (Quran Surah Al-Furqan, 25:27-29)
The verse mentioned above is not the only verse about friendship in the Quran. The following two verses are also about friendship in the Quran.
Allah Almighty says in the Noble Quran, “Friends on that Day will be enemies one to another, except al-Muttaqun (i.e. those who have Taqwa/Piety).” (Quran Surah Az-Zukhruf, 43:67)
Allah Almighty says in the Noble Quran, “And cooperate in righteousness and piety, but do not cooperate in sin and aggression.” (Quran Surah Al-Maeda, 5:2)
The friendship is also recognized in the Hadees and in the sayings of the companions of the Holy Prophet (s.a.w). As an example, a saying of Ali Ibn e Talib (R.A.) is given below.
Ali ibn Abi Talib (R.A.) said, “The felicity of this and the next world lie in two things: firstly, keeping secrets; and secondly, friendship with the good. And the miseries of this and the next world are summed up in two things: firstly, divulging secrets; and secondly, friendship with wicked persons.”
Therefore, as Muslims, it is our responsibility to believe in the verses of the Holy Quran and the clear instructions for befriending or not befriending of the people. This is for our own betterment in the world and in the hereafter.