Idioms/expression that means something can bring great benefit if used correctly?

Fire is a good friend but a bad master.

The old saying "Fire is a good friend but a bad master" is quite true.

[Challenge; 2017]

Fire is a good servant but a bad master [proverb]

Fire is useful when monitored and controlled. Left unchecked, however, it is quite dangerous and destructive.

[Farlex Dictionary of Idioms]

Oxford Reference gives the idiomatic broadening:

Fire is a good servant but a bad master

Something that is benign and useful if well controlled becomes a danger if it is allowed to take over.

And a famous example (in three variants!):

A cautionary statement about statecraft has often been attributed to George Washington. Here are three versions:

  1. Government is like fire, a dangerous servant and a fearful master.

  2. Government, like fire, is a troublesome servant and a terrible master.

  3. A government is like fire, a handy servant, but a dangerous master.

[ Quote Investigator]

And other variants:

  • The press, like fire, is an excellent servant, but a terrible master. [James Fenimore Cooper]

  • Technology is a useful servant but a dangerous master [Christian Lous Lange]

[Know Your Quotes]