to ingratiate with
Verb + preposition (or no preposition)
He tried to ingratiate himself with the boss by bringing him coffee every day.
He ingratiated himself with the neighbours by helping with the move.
—Why is he so nice to the teacher? —He wants to get on his good side before the exam.