The life of a person is largely dependent on the company and people that surround you. By nature people are influenced by the type of company one keeps.
The life of the Sahaba (RA) was shadowed by the best of creations, our Nabi (Sallalahu Alayhi Wasallam) who nurtured and groomed these noblest of personalities to become a group loved by Allah Ta’ala.
We are constantly advised to seek the company of the pious and good people. People that remind you of Allah Ta’ala and who have a close bondage with their Creator attract others to think and behave likewise. Hence, love the friends of Allah Ta’ala because Allah loves them.
In one narration Anas (RA) reports that one person came to Nabi (Sallalahu Alayhi Wasallam) and said, “O Rasul of Allah! A person loves some people but his (the person’s) actions are not similar to theirs (some people) (so what will be his situation?)."
Nabi (Sallalahu Alayhi Wasallam) replied,” A person’s hashr (on the plains of Qiyaamat) will be with those whom he loved (in this world)” (Musnad Ahmad)
This hadith is a great inspiration for all of us that strongly advise us to love the friends (pious) of Allah Ta’ala, despite a person not practicing on the Deen altogether; but because the person was in the company of whom he loved, then surely he will be raised with such people.