take pains with something/to do something
take (great) pains with (something)
To expend a lot of time, effort, and care doing something. Your tutor took great pains with your instruction, but it's obvious that you've totally wasted his time and our money! It's clear that the owners have taken great pains with the interior design of the new restaurant. My grandmother always took pains with her appearance throughout her life, so losing her hair during her cancer treatment was especially difficult for her.
take pains with someone or something
Fig. to deal with someone or something with great care. He really took pains with me to make sure I understood it all. Ken took pains with the model plane.