ingratiate
To act extra nice so someone will like or favor you.
To ingratiate yourself with someone means to deliberately try to win their favor or approval, often through flattery or by doing things you think will please them. When someone ingratiates themselves, they might give excessive compliments, laugh at every joke, or agree with everything the other person says, all in hopes of being liked or gaining some advantage.
You might see this when a new student tries too hard to ingratiate themselves with the popular kids by constantly praising them or copying their style. A character in a story might try to ingratiate himself with a powerful person by bringing gifts and saying nice things, hoping for special treatment in return.
The word carries a slightly negative feeling because ingratiating behavior often seems fake or calculated rather than genuine. There's a difference between being friendly and kind because you actually like someone, and ingratiating yourself because you want something from them. When you read that a character “ingratiated himself with the king,” you can usually sense that the person is being manipulative rather than sincere.
People who ingratiate themselves are working hard to get into someone's good graces, and the effort often shows.