We gain and lose many friendships in life. It shows that Allah swt is our True Friend, and we should make friendships based on Him and not become attached to the dunya.
The Qur’an says about Day of Judgement, the time of need, (43:67):” Friends on that day will be foes, one to another,- except the Righteous.”
Good friends have many benefits, and bad friends often have the opposite affects (i.e. opposite of the benefits).
Benefits of good friends are:
1) -Improve character and decreases faults of ourselves
2) -Improves knowledge
3) -Increases good deeds
4) -Helps us in times of need, in this world and the next
5) -Friendships last longer as they are based on Allah Most High, through patience, mercy, good manners and love
6) -Helps us sincerely
7) -Leads to pleasure of Allah Most High and closeness to Him
8) -Reminds one of Allah Most High
"Allah Almighty says, 'My love is mandatory for those who love one another in Me and sit together for My sake and who visit one another for My sake and who give generously to one another for My sake.''" [Muwatta']
So let us insha’Allah love each other for Allah’s sake, and not for reasons of selfishness or worldly benefit.