When you want to make someone like you, what do you do? Compliment them? Buy them dinner? One of the best ways to win someone over is to ask a favor of them. It works via a phenomenon called the Benjamin Franklin Effect.
Though we think that our actions take a certain progression — we want to do things and then do them — it's often the opposite: we see ourselves doing something, and only later do we come up with a reason to justify why we did it. The Benjamin Franklin effect games this quirk of psychology to make the other person assume they liked you all along.
The effect is named for the way the founding father once used this principle when he encountered a bitter political rival. Because the rival's admiration would be useful to him in the future, Franklin wrote to the man asking to borrow a certain rare book from his library. The rival obliged, and Franklin sent the book back a week later with a thank-you note. The next time the two men saw each other, the rival approached Franklin and spoke to him in person for the very first time. The two stayed friends for life.
As Franklin wrote in his autobiography, "He that has once done you a kindness will be more ready to do you another, than he whom you yourself have obliged." In the book-lending scenario, the rival saw himself doing Franklin a favor, and rationalized his actions: you do favors for people you like, so he must like Franklin after all.
So the next time you try to endear yourself to the colleague who just hasn't warmed up to you, forget bending over backwards to help him out. Instead, ask him for something. It might be just the trick you needed.