Quick answer
Company sets direction. The verse treats friendship as a decision with consequences rather than as something that simply happens.
Read both lines
The first line is counsel rather than description, which is slightly unusual in a chapter of observations, and the second line supplies the reason: a road has an effect on whoever walks it. The logic is the same one chapter 1 used about a gang's invitation and chapter 5 used about a street, that proximity does most of the work people credit to willpower. Nothing here recommends avoiding people in general or treating anyone as contagious. It observes that a person tends to end up going where their companions are already headed.
Related: Proverbs 1:10–15 · Proverbs 13:20 · 1 Corinthians 15:33
New King James Version®, Copyright © 1982, Thomas Nelson. All rights reserved. Full copyright information. Scripture provided by API.Bible.
Go Deeper
If this verse has been used to put weight on you that it was never carrying, ask about it directly.