Answer :

There are several ways to prevent rusting. But you first need to know that rusting is caused by surrounding elements(wind,water,cold/heat etc)
So to prevent it, you need to have a coating protecting what you want to protect.
Some ways are to apply anti-rusting oil which is coating and another way I know that I know that they do for large buildings/structures such as bridges(the Golden gate bridge in San Fransisco is no exception) is to apply a special paint that protects then from rusting. But if there is even a little chip or crack in the paint, it can cause rusting in that area and slowly go under the paint and spread so workers have to sometimes repaint those spots to get rid of the rust.
rusting is caused by weathering so keep away from elements