A man who associates with an inferior goes downhill,
but associating with an equal,
you’ll never decline; following the best,
you’ll quickly rise up,
so you should keep company
with people better than you.”
- AN 3.26
“These three people are found in the world. What three? There is a person you shouldn’t associate with, accompany, or attend. There is a person you should associate with, accompany, and attend. There is a person you should associate with, accompany, and attend with honor and respect.
Who is the person you shouldn’t associate with, accompany, or attend? It’s someone who is inferior in terms of ethics, immersion, and wisdom. You shouldn’t associate with, accompany, or attend such a person, except out of kindness and compassion.
Who is the person you should associate with, accompany, and attend? It’s someone who is similar in terms of ethics, immersion, and wisdom. You should associate with, accompany, and attend such a person. Why is that? Thinking, ‘Since our ethical conduct is similar, we can discuss ethics, the conversation will flow, and we’ll both be at ease. Since our immersion is similar, we can discuss immersion, the conversation will flow, and we’ll both be at ease. Since our wisdom is similar, we can discuss wisdom, the conversation will flow, and we’ll both be at ease.’ That’s why you should associate with, accompany, and attend such a person.
Who is the person you should associate with, accompany, and attend with honor and respect? It’s someone who is superior in terms of ethics, immersion, and wisdom. You should associate with, accompany, and attend such a person with honor and respect. Why is that? Thinking, ‘I’ll fulfill the entire spectrum of ethical conduct I haven’t yet fulfilled, or support with wisdom in every situation the ethical conduct I’ve already fulfilled. I’ll fulfill the entire spectrum of immersion I haven’t yet fulfilled, or support with wisdom in every situation the immersion I’ve already fulfilled. I’ll fulfill the entire spectrum of wisdom I haven’t yet fulfilled, or support with wisdom in every situation the wisdom I’ve already fulfilled.’ That’s why you should associate with, accompany, and attend this person with honor and respect.
These are the three people found in the world."
In this teaching, the Buddha shares that is is beneficial to associate with people who are equal in ethics, immersion (concentration, samādhi, jhānas) and wisdom as you are.
The Buddha further shares that it is beneficial to associate with people who are superior in ethics, immersion and wisdom, and to attend them with honor and respect.
This is a detailed version of what is shared in brief in the factors of awakening to the truth (stream-entry) where the Buddha shares on associating with wise people (external link).