The easiest way to repaint a wrought-iron fence -- and to have your paint job last as long as possible -- is to prepare the fence correctly before painting. If the fence has spots of rust (and it's hard to imagine why you would be repainting it if it did not), and you leave even a little on the fence, the metal will continue to deteriorate under the new paint and you will have more rust, and another paint job to carry out, within a very short period of time. Exactly how you prepare the fence depends to some degree on how intricate the ironwork is.
Put on heavy work gloves, safety goggles and a respirator. Scrub the fence with a wire brush to remove flaking paint and rust. If the paint on the fence has bubbled, there is a rust underneath. Break through the bubbles with a screwdriver and then scrub with the wire brush. Remove deep rust with a coarse file. In place of a hand-held wire brush, you could use a wire wheel brush attached to an electric drill for this step.
Sandblast the fence if the ironwork is too intricate to clean with a wire brush. Rent or buy a portable 10-gallon sandblaster and a compressor. Assemble and operate the device according to the manufacturer's instructions. Sandblasting will take the fence down to bare metal, so you can skip steps 3 and 4.
Place several sheets of old newspaper under the fence to avoid damaging plants, grass or building materials such as brick. Spray every surface of the fence with a commercial rust remover. This will get rid of any rust you have missed. You can buy rust remover in a spray can, but if your fence is more than about five feet long, you would do better to rent a paint sprayer from your hardware or home improvement store. Assemble and operate the sprayer according to the manufacturer's directions.
Sand all surfaces of the fence with 80-grit sandpaper. Use a sanding block that will conform to the surfaces of the fence to make this job as easy as possible.
Clean the fence with a solution of TSP and water applied with cloth rags. Rinse the fence thoroughly and allow it to dry. Primer and paint will stick much better to an absolutely clean, degreased fence than to one on which you have not taken this extra step.
Brush or spray on a coat of rust-inhibiting metal primer. Your choice of whether to use spray cans or a paint sprayer will depend on the size of the fence. If you have not placed old newspapers under the fence, do so before you apply the primer.
Paint or spray the fence with black rust-resistant paint for metal. Follow the manufacturer's instructions for how many coats you should apply and how long you should wait for each coat to dry.