Replacing Rotted Exterior Window Trim
To actually remove the old exterior window trim, use a flat bar and a hammer to get underneath the nail heads and pry the nails from the window trim. After the nails are removed you should be able to easily remove the old exterior window trim from around the windows by simply pulling on the pieces.
You may need to use your flat bar, however, be careful not to damage the house siding when using it. Use a small block of wood to help protect the house siding when using the flat bar. After removing the old exterior window trim, inspect the window area for any additional rot or damage to the window itself. Assuming there is none, you can continue with replacing the exterior wood trim.
Once you have installed the top window trim fasten it with nails. I like to use two nails on each side edge, and two in the middle, with one nail about 2 inches above the other. If you are using solid plastic exterior window trim, then use a manufactured suggested adhesive and make sure you apply it to all joints and corners. Next, install the side exterior window trim pieces by first measuring and cutting pieces to the appropriate length. Again, apply caulk to the house siding edges and the window edge prior to installing the replacement exterior window trim.