Grip the carpet in one edge of the room with carpet pullers. Pull back and loosen the carpet from the tacking strips or adhesive. Do not be too aggressive or you will rip the carpeting. Reveal the subfloor portion that needs to be replaced. Roll the carpeting up and secure it while you work.
Remove the damaged portion of plywood with a handsaw. If the entire sheet is ruined, you can pry it off with a pry bar. Otherwise, use a handsaw to cut out the affected area.
Measure the spot for the replacement sheet of plywood. Use a measuring tape to get the length and width of the replacement area.
Cut a new sheet of plywood to fit, using a circular saw. Avoid rushing the wood through the saw or you will create a jagged edge.
Fasten the new plywood to the floor joists with a hammer and nails. Line up the new sheet and lay it down. Make sure there are no gaps between the seams of the new and old plywood. Insert one nail per 12 inches for each floor joist.
Roll the carpet back out and reattach it. Carpet tacking strips make this job easier. Stretch the carpet back into place. If you prefer adhesive, coat the subfloor with adhesive first, then press the carpet into place. Otherwise, roll it out and then tack it into place along the edges of the room.