Remove the two brackets from the fixed side of the sliding door, using a screwdriver to take out the screws.
Lift up on the door so the bottom wheels are out of the lower track, and pull forward on the bottom to remove the door. Have an assistant help you, since the door will be heavy.
Remove the nails from the old door frame, using a hammer.
Pull the threshold forward, and pull the frame away from the opening.
Remove any rotted wood from the door frame, using a pry bar.
Cut a new piece of 2-inch by 6-inch board, using a saw, and put it in place of the rotted wood. Measure the level of the 2-inch by 6-inch board and slide shims --- scrap pieces of wood --- under the 2-inch by 6-inch board where it isn't level. Nail the board down with a nail gun, and then cut the shim flush with the threshold, using a utility knife.
Cover the new framing with sheet flashing. Cut pieces of sheet flashing, using tin cutters. Fold the flashing over the top of the framing and nail it down with galvanized roof nails.
Bend the flange, a metal piece installed around the door, out from the door. It is folded into the door to prevent damage during shipping.
Run a 3/8-inch bead of silicone caulk down the center of the door flange. Place another 3/8-inch bead of caulk an inch away from the outside edge of the door threshold.
Lift the door up and place it bottom first into the door opening, onto the bead of caulk. Tilt the door in place. Check the level of the sides, top and bottom of the door.
Hammer in finishing nails along the door frame, as indicated in the installation instructions for the door. Install the molding around the door, using the same instructions.