strike the right note
Say or do what is especially appropriate, as in She struck the right note when she complimented the new parents on their baby. This expression alludes to playing the correct note on an instrument.
The American Heritage® Idioms Dictionary Copyright © 2002, 2001, 1995 by Houghton Mifflin Harcourt Publishing Company. Published by Houghton Mifflin Harcourt Publishing Company.