Not everyone at work has to like you in order for the office to run smoothly. Sometimes people just rub each other the wrong way; in other cases, one-sided rivalries develop from slights that are perceived but never intended.
If you have a coworker who doesn't like you, it's important to consider whether it's a situation worth addressing. When the other person's feelings don't impact the work you do or hurt the company, then it may be best to leave well enough alone.
When the bad blood (either perceived or real) does make the workplace uncomfortable or impacts how things get done, then you need to clear the air. That's not a fun conversation to have, but it's one that can often lead to an improved relationship, a better work environment and even friendship.
If you find yourself in this situation -- where someone else in the office is showing signs they don't like you -- it's best to address it with care. Don't storm up to the person and confront them, but instead, ask them to grab a cup of coffee, your treat, or schedule a private meeting.
Once you're sitting down with them, use soft language to explain the purpose of your conversation. Don't accuse the other person of not liking you for whatever reason. Don't list all the slights you've taken as signs of their feelings toward you. Instead approach it in a gentle way: "I feel we may not have the best working relationship, and I'd love to work on that together."
Open the floor to them and accept blame: "If there's something I've been doing wrong, please know it wasn't intentional and I want to apologize for it."
Don't minimize their feelings or invalidate their pain, if they choose to share why they are upset. Let them feel heard and apologize whole heartedly where you should. Tell the person you're open to finding a solution if there's a true problem between the two of you.
Of course, sometimes you already know what's wrong or what you did to them.
Many years ago, I worked as the Sunday editor for three papers, and one of my jobs was filling in for the daily editors when they were out. One of those editors was openly hostile to me because he perceived me as being out for his job. I took him aside one day and openly told him I had no interest in his job, because it would have been a brutal commute. I also let him know that while I had a cordial relationship with the big boss, I wasn't social friends with him, as the slighted editor believed. It was a simple clearing of the air. He believed some things to be true that weren't in reality, and our conversation ended with a dinner invitation.
In my case, we actually became casual friends, but that doesn't have to be the outcome. It's OK just to get the issues out on the table and defuse a tense situation so your working relationship isn't strained in future projects together.
When in doubt, ask
If you're at all concerned about how to handle this type of situation or whether you should address it at all, start by asking your human resources (HR) department or your boss. Usually HR profesionals want to facilitate this type of discussion, and sometimes adding your boss to the mix can also defuse tension. It will also show your boss that you're being proactive about improving your workplace skills.
Resolving bad blood between yourself and a coworker should be handled very carefully. The other person may have a deeply held and valid reason for not liking you, and a casual meeting may not be enough to rectify it in one sitting. Perhaps you can suggest to your boss or HR department a team trip to an Escape Room or other teambuilding activity to strengthen your team's bond.
In many cases, though, extending an olive branch goes a long way toward fixing most situations. Sometimes just showing a willingness to hear them out and work together to resolve things will be taken at face value, and actually fix them.