On the authority of Abu Musa al-Ash'ari (radiAllahu anhu), the Prophet (salAllahu alayhi wasalam) said:
"The likeness of a righteous friend and an evil friend, is the likeness of a (musk) perfume seller and a blacksmith. As for the perfume seller, he may either bestow something on you, or you may purchase something from him, or you may benefit from his sweet smell. And as for the blacksmith, he may either burn your clothes, or you may be exposed to his awful smell."
[Bukhari and Muslim]
This is one of the many narrations from the Prophet (salAllahu alayhi wasalam), which is striking in its simile, wonderful in its rhetoric, and ingenious in its explanation. The Prophet (salAllahu alayhi wasalam) would always explain concepts in the simplest way, and yet their effect on the human heart would be fantastic. This is especially important considering human beings are of all different cultures, intellects and understandings, and the words of the Messenger (salAllahu alayhi wasalam) transcend all these barriers.
"The likeness of a righteous friend and an evil friend, is the likeness of a (musk) perfume seller and a blacksmith.."
This first sentence is the object of the hadith-friendship. In the Arabic, the Prophet (salAllahu alayhi wasalam) starts with the restrictive word innama, which is very difficult to incorporate into the English translation while at the same time maintaining its coherence. The inclusion of this first word means the comparison that the Prophet (salAllahu alayhi wasalam) is making is a very exact one, even though it may not be literal.
There is no doubt friendship is an integral part of life for all human beings. A very interesting point is that the Arabic word for human is insan. Scholars have pointed out there may be several words where insan is derived from. One of these is isti'nas, which means pleasure or joy from another's company. This implies that human beings are naturally social, communal creatures, who have a need for each other. Here the Prophet (salAllahu alayhi wasalam) recognises this fact and gives a stern warning, as well as some warm advice.
In fact, the Prophet (salAllahu alayhi wasalam) has frequently stressed on the importance of one’s friends or immediate social surrounds. For example, he (salAllahu alayhi wasalam) said:
"A man is on the religion of his close friend, so each of you should look to whom you take as close friends."
This powerful advice stems from Revelation, as Allah (Ta'ala) created human beings to be social. It is also backed by thousands of years of human experience, and is also corroborated by modern science. Countless completed studies suggest that peer pressure is vital in the way humans behave, particularly in our youth, driving them towards smoking, drugs, alcohol and vulgar sexual behaviour.
Even more seriously, an evil social group eventually drives one to negligence in obligatory actions and disbelief. An example of this, discussed later, is even mentioned in the Qur'an. So how does this work? The Prophet (salAllahu alayhi wasalam) explains:
"As for the perfume seller, he may either bestow something on you, or you may purchase something from him, or you may benefit from his sweet smell.."
The company of the righteous friend is where the heart is at rest, and where the spirit is in harmony. It is the person who makes one truly happy. He/she provides encouragement during times of hardship and is also there to provide motivation in times of ease. But most importantly, the righteous friend improves one’s Islamic character and Iman.
According to the Prophet (salAllahu alayhi wasalam) the benefit comes in three forms. Firstly, he may provide you with an easy avenue for good deeds, such as reminding you of Allah (subhanahu wa Ta'ala) or perhaps telling you a hadith you have never heard. In essence, he has provided you with a gift.
Secondly, he may provide you an avenue to good deeds that perhaps requires some effort on your part, such as encouraging you to give charity.
Thirdly, you may simply benefit from his presence, which provides an inner sense of peace, and a softening of the heart.
Sahih International
"Indeed, [O Muhammad], you do not guide whom you like, but Allah guides whom He wills. And He is most knowing of the [rightly] guided." (Al-Qasas 28:56).
Meaning, Allah holds the heart of people in giving Hidaaya, we as normal human just like a 'mediator' to other people's hidaaya. By being a good friend, our good advice would give possibilties of giving good virtue lesson(s) to our friend(s) and ourselves. :)
Source: 1 and 2