do the trick vs nail it

do the trick

verb
  • To work; to be successful; to solve a problem; to be sufficient or adequate to fulfill a purpose. 

nail it

verb
  • Synonym of hit the nail on the head 

  • Used other than figuratively or idiomatically: see nail, it. 

How often have the words do the trick and nail it occurred in a corpus of books? (source: Google Ngram Viewer )