The sill is a fundamental part of a window frame, and one attacked by rot can mean major repair work.
A window frame is constructed in the same way as a door frame and can be repaired in a similar way. All the glass should be removed first, preferably by removing the sashes. Be sure to check the condition of the subsill (part of the rough frame).
Rot can extend into this region also if the opening was not covered with building paper. After repairs have been made, be careful to thoroughly weatherproof the window frame to prevent moisture from entering again.
Reapply fresh 15-pound asphalt-saturated building paper around exposed parts of the rough frame, then caulk all seams where the window frame itself contacts the exterior of the house. Repairing sills is difficult and time-consuming, so plan to do such work during good weather when window openings can be covered with polyethylene while work progresses.
Ideally, to replace a rotted window sill you should remove the entire window, carefully disassemble the old sill from the jamb sides, use it as a template, then cut and fit a new sill and replace the window.
However, sills may be replaced with the window in place, provided you work patiently and have some skill at scribing and shaping wood with a chisel.
Begin by carefully splitting out the old sill. Cut through it crosswise in two places with a saw to remove the middle portion, then gently pry the end sections away from the jambs. Hacksaw any nails holding the sill to the rest of the frame.
Use a piece of cardboard to make a template for the new sill, shaped to fit between the jambs but beneath the casing on the outside. Cut a 10-degree bevel along the upper outside edge of the sill, extending to the inside edge of the sash, then bevel the sash area so it is level when the sill is installed.
Fill the area beneath the sill with insulation, install the sill with 16d finishing nails, then thoroughly caulk the seams.