Your collegues are not your friends
They can be friendly but the issue comes down to a potential clash in interests. Lets say there is only one slot available for promotion, would you two resolve it ammicably? Lets raise the stakes, picture this, their partner just got laid off recently and could really use the upcoming bonus. However, the project you all were involved in did not perform, and now they are on the hook for the results. They can either take the blame, and put themselves in a deeper hole financially, or they can deflect the blame to someone else (you). The idea here is not to ask you to question everyone’s morals, but to help you realise that within the workforce, the best way to maintain relationships is to ensure that your interests are aligned. Generally, the best way to maintain a friendship between collegues is if one leaves, then there will no longer be any potential clash in interests.