Crawl on your hands and knees around the bathroom, identifying the area that is soft and gives under your weight or pressure. Test the floor by pushing on it with your hands. In most cases the entire floor is not damaged. Get an idea of where the bad flooring ends before you begin.
Tear up the top floor covering. The exact method of attack will vary depending on the material. You may need to cut the carpeting to reveal the subflooring beneath; linoleum will come up with the subfloor but hardwood flooring needs to be torn loose with a pry bar or cut with a reciprocating saw. Ceramic tile must be broken apart to expose the plywood subfloor. Damage to the floor covering is unimportant as you will replace it when you are done to prevent mold or mildew.
Turn off the water, either at the water meter or near the water heater. Alternatively, turn the shutoff valve located near the toilet.
Remove the toilet if necessary. Unscrew the nuts that anchor the toilet to the floor. Lift the toilet straight up and move. Put a rag in the drain hole to block odors from entering the bathroom. The sink and vanity generally do not require fixture removal since they usually block the invasion of water that causes your floor to degenerate.
Break through a soft spot in the floor to get the removal started. Use a pry bar to dig up rotted plywood subflooring, gradually enlarging the opening. Switch to a reciprocating saw to continue cutting away flooring, watching for electrical lines, plumbing or heating ducts as you work. Cut carefully around these areas. You must ensure you are well into good wood to ensure the rot doesn't spread into the repair.
Clear away the rot as you work to allow for adequate work space. If you see evidence of mold or mildew, put a dust mask on and seal removed material in a plastic garbage bag immediately. Mold spores -- especially black mold -- can be toxic. Consider hiring a professional to remove extensive areas of mold.
Inspect the floor joists running under the floor area to identify rotted areas. Push a screwdriver into each beam revealed, in several spots, to find areas that feel mushy and rotten.
Measure the diameter of the current joists as well as the length of the rotten section of each joist. Most joists are 2-by-8 or 2-by-10 inches. Add at least 2 feet to either end of the measurement. For example, a 2-by-8-inch joist with a 3-foot rotted section translates to a 2-by-8 board 7 feet in length.
Cut sections of the proper size of board, one per rotten joist at minimum, although two boards per joist is better if you can afford it and have the space. Two boards allow you to sandwich the old joist between them and offer added floor stability.
Align each new beam along the old joist, allowing the excess length to overlap the good portion of the joist on either end of the deteriorated section. Nail through the new beams into the old joist 2 inches from the top of the board, with another nail slightly staggered and 2 inches from the bottom, every 4 to 6 inches. Attach another beam on the other side of the joist if using two boards per joist. This method is known as sistering the joists together.
Find the width of the area between the sistered joists. Cut additional blocks to this length. Insert between adjacent joists, one for each 3 to 4 feet of joist length, and nail in place to secure. You may need to toenail these boards -- called noggins -- by driving the nails at an angle through the noggin into the joist with three or four nails.
Cut plywood as necessary to fit the exposed floor area. Lay each sheet in place, pushed snugly against adjacent surfaces. Use a drill to drive screws through the plywood every 6 inches around the perimeter of the sheet and every 8 to 12 inches in the interior. Drive the screws slightly below the surface to ensure the heads do not protrude. Finish by reinstalling the floor covering and toilet, along with a new wax ring to seal the fixture.