How to remove rust from gears?
By "gears" I assume you're talking about the rear sprockets, or perhaps the smallest front sprocket, since they're about the only "gears" that are made of steel.  And they shouldn't get rusty if properly oiled.

A little rust won't hurt the sprockets.  Just oil the chain with good chain oil and it will transfer to the sprockets fairly readily -- the rust will wear off with a little use.  More worrisome is the chain itself, since a little rust can hurt a chain, causing "frozen links" and accelerating wear.  Again, oil it with proper bike chain oil.