Nip (something) in the bud

To stop something before it becomes larger (you can destroy a flower bud before it becomes a flower).

We were able to nip the computer problem in the bud.