Flattery was the act of complimenting a person profusely, often done in order to get something from them. Depending on who you asked, it could either be a strong motivator or a useless endeavor.
In 2266, James T. Kirk gave Doctor Leonard McCoy the job of instructing Charles Evans on the medical aspects of adolescence (i.e. puberty, etc). When McCoy suggested Kirk for the job, saying Charlie already looked up to him as a father figure, Kirk doubled down, saying flattery would get McCoy nowhere. (TOS: "Charlie X")
In 2270, after McCoy praised Sarah April's intelligence and beauty, comparing it to the Capellan flower she wore, April assured him that flattery would get him everywhere. (TAS: "The Counter-Clock Incident")
Imitation was said to be the highest form of flattery. In 2368, Data reassured Timothy that he did not consider the boy's efforts to act like a Soong-type android to be silly, but rather flattering. (TNG: "Hero Worship")