With bullies you have to show them both that they can't get to you, and that if they push too hard, you will call them out on their shit.
It sounds simple, but I know it isn't. The best thing you can do is set precedents early; e.g., if they say anything shady, stare them dead in the eyes and respond, "I don't think that's true at all" or whatever else is relevant to the situation.
Don't try to befriend them; don't try to make nice; do remain polite. If they're a colleague, they're just a colleague; you don't need to try to get on their good side but y'know, keep things nice and neutral if you need to interact with them. Bullies love people pleasers because people pleasers are, unfortunately, the easiest to manipulate.
There's been advice so far about going directly to your boss or to HR, but that will definitely depend on where you work. In my experience, your boss may think you're weak/incompetent/an idiot/wasting their time if you complain to them about interpersonal issues and HR exists to protect the company, not you, so please be careful. Unless it's to the level of something actionable, I personally wouldn't go up the ladder for workplace bullying type issues it as it can really backfire on you, but who knows - some people actually have supportive work environments, ha ha. Note of caution; you may also ruin your rep with the rest of the office, as they'll view you as being a "whiner" and "not a team player".