take (great) pains (to do something)
To expend a lot of time and energy doing something. Your parents took great pains to ensure that you would have enough money for college. My grandmother always took pains to look her best, so losing her hair during her cancer treatment was especially difficult for her.
take (great) pains (to do something)
Fig. to make a great effort to do something. Tom took pains to decorate the room exactly right. We took great pains to get there on time.