You have to remove the entire cam shaft as the gear is attached thereto:
Engine out of tractor
front cover off engine
remove both valve covers
remove both spark plugs
turn engine to top dead center (mark on cam and on fly wheel) - rotate flywheel by hand to turn
cam shaft seats in the back of engine block in a recess. Should fall loose with a pull forward. Push rods shoulds fall out. finess the cam shaft/push rods to get all 4 push rods to fall down in engine block, easier if loosen rocker arms so push rods have plenty of free play. Remove push rods and replace them. New push rods easiest installed from the valve end after the cam is in place. You'll have to loosen rocker arms to get push rods in. Rotate cam by hand and check that push rods operate correctly. Pay attention to put cam gear back in with T.O.C. properly oriented.
After engine back together, tighten rocker arms and adjust valve spacing per manual. It's also best to change governor gear, water pump, oil pump, a bunch of seals and gaskets, including valve seals while in there.
biggest job is getting engine out of tractor. Rest is pretty easy if you take your time.