do the trick

Intermedio (B1) informal

To work or solve the problem.

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