at pains, be at

Also, take pains. Make a special effort or take extra trouble to do something. For example, Bob was at pains to make a good first impression and wore his best suit, or Mary took pains to make sure her speech would interest the audience. [First half of 1500s]

The American Heritage® Idioms Dictionary Copyright © 2002, 2001, 1995 by Houghton Mifflin Harcourt Publishing Company. Published by Houghton Mifflin Harcourt Publishing Company.