Your friend is not one who encourages you to come down to your lowest level, encourages you to do foolish things along with him or fall into bad ways with him or one who commends you for all the nasty things you do, that’s quite clear.
We don’t like the company of someone who has a contagious disease, and avoid him carefully; generally he is segregated so that it does not spread. But the contagion of vice and bad behaviour, the contagion of depravity, falsehood and what is base, is infinitely more dangerous than the contagion of any disease, and this is what must be very carefully avoided. You must consider as your best friend the one who tells you that he does not wish to participate in any bad or ugly act, the one who gives you courage to resist low temptations; he is a friend. He is the one you must associate with and not someone with whom you have fun and who strengthens your evil propensities. That’s all.
Now, we won’t labour the point and I hope that those I have in mind will understand what I have said.
Indeed, you should choose as friends only those who are wiser than yourself, those whose company enables you and helps you to master yourself, to progress, to act in a better way and see more clearly. And finally, the best friend one can have—isn’t he the Divine, to whom one can say everything, reveal everything? For there indeed is the source of all compassion, of all power to efface every error when it is not repeated, to open the road to true realisation; it is he who can understand all, heal all, and always help on the path, help you not to fail, not to falter, not to fall, but to walk straight to the goal. He is the true friend, the friend of good and bad days, the one who can understand, can heal, and who is always there when you need him. When you call him sincerely, he is always there to guide and uphold you—and to love you in the true way.
Ref : Questions and Answers 1957-1958