I've always done this by hand at first, keeping the lights on the car but taping around the edges with blue tape so as not to sand any of the paint.
Depending on the how badly oxidized or encrusted the lights were, I start by wet-sanding using an 800 grit, working my way up through the grits to 1000, 1500, and 2000, all by hand. Takes probably a half hour for it to come out right, just for the sanding part.
Then I use an electric buffer, starting with 3M Protect-It buffing compound and foam buffing wheel, and then using the 3M Protect-It polishing compound with a foam polishing wheel. Then some protective wax.
Using a buffer for the final stages saves a lot of time.