In Chaitanya Caritamrta Lord Caitanya says that sadhu-sanga, the association of a great saintly person, is very important, because even if one is not advanced in knowledge, simply by association with a great saintly person one can immediately make considerable advancement in spiritual life.
A devotee should always aspire to live in the association of advanced devotees and engage in the service of the Lord through the parampara system.
An intelligent person should reject all bad association and instead take up the association of saintly devotees, whose words cut off the excessive attachment of one's mind.
Through the association of devotees, one can engage in the service of the Lord by hearing and chanting. Thus one can revive his dormant Krishna consciousness and sticking to the cultivation of Krishna consciousness, return home, back to Godhead, even in this life.
The most essential point of avoiding bad association is to give up the bad association of one's materialistic mentality.
As we associate with others in our spiritiual communities, we should do so in a mood that these are the people that I am living with and they will probably also be the people that I will leave this body with.