Answer:
We use electrolysis to prevent a material from rusting,
The metal forms a coating around the material and hence prevents any contact between the material and the environment
This process also gives us the physical strength of the material and the aesthetic properties of the coated metal
the metal commonly used to coat the object is Zinc and the process is called galvanisation