do the trick

中级 (B1)informal

To work or solve the problem.

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