Turn off the water supply at the valve at the back of the toilet, often under the tank. Use a wrench to disconnect the flexible water line from the toilet where it meets the valve. Flush the toilet to empty the tank and bowl.
Unscrew the bolts at the base of the toilet with your wrench. Lift the toilet directly upright and set onto a tarp or outside. Pull the flange out of the drain where the toilet was. If the flange is in good condition, with no cracks or distortions, you can clean and reuse it.
Pull up the existing flooring, such as linoleum or tiles, in the immediate area, to expose the wood underneath. Mark a rough outline around the rotten area with a pencil working 3 to 4 inches out from the line of damage. Use a T-square to draw a rectangle or square around the outside of your drawn lines.
Cut out the rotten portion along your rectangle or square lines. Measure the dimensions of the removed piece and cut a fresh rectangle or square the same size with ¾-inch plywood. Cut a drain hole into the new wood identical in size and location to the hole on the old wood.
Position the new plywood into place on the floor. Secure the wood with nails to the floor joists below, hammering each nail down until the head runs flush with the plywood. Install the previous flange or a new one, if necessary, over the wood aligned with the drain.
Install new flooring or replace any removed tile, working around the drain opening. Clean around the base of the toilet and replace on the floor where it previously .