Unscrew the trim screws from the strike plate on the edge of the door with a Philips screwdriver and remove the plate.
Pull the knobs apart and remove them from the door. If they do not come apart readily, look for a poke hole on the handle or knob and press it with the tip of a Philips screwdriver to release the knobs.
Insert a flat head screwdriver into the hole in the end of the spindle protruding from the side of the knob with the keyhole. Turn the spindle counterclockwise, as far as it will go.
Locate the square retaining tab at the base of the spindle. Insert the end of the flat head screwdriver beneath the tab and pry the tab away from the spindle base.
Hold the knob in one hand and place the tip of the screwdriver against the spindle base. Push until the cylinder pops out of the front of the knob.
Insert the replacement cylinder into the front of the doorknob. Press firmly until the cylinder clicks into place.
Insert a flat head screwdriver into the end of the spindle and turn it clockwise as far as it will go. Insert the key into the keyhole to test the cylinder.
Insert both sides of the door knob back into the knob holes and through the cylinder until they click into place. Replace the strike plate and trim screws and test the lock.