Proverbs 13:20:
Whoever walks with the wise becomes wise,
but the companion of fools will suffer harm.
Proverbs 27:17:
Iron sharpens iron,
and one man sharpens another.
Daniel J. Estes, Handbook on the Wisdom Books and Psalms (Baker Academic, 2005), page 239:
Proverbs makes it clear that friendship has a great potential for good or for bad. In essence, we choose our friends, and our friends change us. … The influence of a wise friend can sharpen one’s discernment, perspective, and insight in many ways that one could not achieve by individual efforts. Because of the significant effects that friends produce in those who are close to them, to a large degree the friends we choose determine what kind of people we become. Consequently, we must choose our friends wisely, for in choosing them we are likely choosing our own future.