Unless you want to replace your water heater more frequently then necessary, replace the anode every 3-6 years (depending on how hard your water is). Use magnesium for city water, aluminum for well water. If there is a ceiling above your water heater you should purchase a segmented anode rod (it doesn't matter if you bend and destroy the old one taking it out). Measure the length of the old anode after you remove it (if there is anything left) and cut the new one to the same length. Alternatively, you can drop a measuring tape through the opening and measure the length to the bottom of the tank, cut the anode an inch or two shorter than your measurement.
You will need a 1/2" drive 1 1/16" 6-point impact socket. The thing can be a real bugger to get out. Mine was so tight that I had to use a breaker bar with a 5 foot cheater pipe, my air impact wrench wouldn't budge it. Don't drain the water heater before you attempt to take it out (but turn-off the water feed and relieve the water pressure on the hot side), you need the weight of the water in order to get that old anode loose, even then, I had to use a ratchet strap with a piece of wood wedged against the wall to keep the water heater from turning, it was THAT tight.
Eventually, when you have to replace the water heater, BEFORE you install the new water heater remove the anode, put some pipe sealant on the threads and reinstall it JUST SNUG ENOUGH to keep it from leaking (or have the plumber do it).