A friend gives us validation, which could push us to do things we don't want in some situations.
We can also be betrayed by a friend, and our outlook on life/perspectives shift into darker territory, particularly if you are isolated and stuff...
Someone you consider to be a friend may also not have your best interests at heart, or may have a completely wrong impression of you, and may not protect you from danger when you need it most.
Despite those, IMO friends are kind of essential from a mental health perspective - we're social beings, isolation can bring out the worst in us. Whenever you come across someone that shares your values, keep them close 👍