

There is no ‘supposed to’ about making friends with people you work with. Some may have that opinion but lots of people have made friends with coworkers. Sure if the friendship goes sour it could get awkward at work, but lots of people can navigate friendship without drama.
It’s hard to tell nuance from a text rendering of that conversation, but it potentially sounds like you were rude to coworker 2, reacting dismissively to their comment.
like most things, conversation skill is mainly not a conscious thing. any skill a human is reasonably good at is done mostly by unconscious parts of brain, under only loose direction from your conscious mind. most things happen too quickly for deliberate conscious reasoning, which is rather slow. you can’t expect to create a set of rules to run through in your head while you converse. it is more like training a neural net, or an llm or something. you give it feedback, like when you make someone angry, you tell it ‘don’t do that’ (ideally just in the form of feeling bad) and eventually it learns. but it takes time.