do the trick

Intermediate (B1) informal

To work or solve the problem.

"A little oil on the hinge did the trick."