The Buddha explains the importance of good friendship in the development and cultivation of the noble eightfold path.
Kalyāṇamitta sutta - Good Friend
"Bhikkhus, just as the dawn precedes and predicts the rising of the sun, so too does good friendship precede and predict the arising of the noble eightfold path for a bhikkhu. For a bhikkhu with good friends, it is expected that he will develop and extensively cultivate the noble eightfold path.
How, bhikkhus, does a bhikkhu with good friends develop and extensively cultivate the noble eightfold path? Here, bhikkhus, a bhikkhu develops right view dependent on seclusion, supported by dispassion, based on ending, culminating in complete relinquishment; similarly he develops right intention, right speech, right action, right livelihood, right effort, right mindfulness, and right collectedness, dependent on seclusion, supported by dispassion, based on ending, culminating in complete relinquishment. It is in this way, bhikkhus, that a bhikkhu with good friends develops and extensively cultivates the noble eightfold path."