keep on the good side of (someone)
To remain the object of someone's favor; to do something that causes someone to be pleased. The superintendent is a powerful woman in the school district, so be sure to keep on the good side of her. I'm hoping to keep on John's good side with this cake I baked for him.
get/keep on the right/wrong ˈside of somebody
try to please somebody and not annoy them/annoy somebody and make them dislike you: She got on the wrong side of her boss after criticizing him in a meeting.