Lack of care, insects, even weather are reasons for you to have to replace exterior trim on a window in your home. There are many types of materials used for this job but wood is very susceptible to weather and bugs but is the least expensive. Plastic trim is the most commonly used due to the fact it needs very little care.
You will need:
Step 1: Take off old trim by using a pry bar under the trim. Pry from under the siding area and not from the window area. You can always use a piece of wood under the bar to help keep from damaging the underlying wood and supplies. Pry the trim up and off along the trim line, and follow this line all the way around the window to avoid damaging underlying structures. Clean the window frame if needed, and if damp allow it to dry for 24 hours.
Step 2: Use the old trim as a template for cutting the new trim. Cut the corners using a miter saw, set at a 45 degree angle for all corners. Since plastic trim is already primed, you will not need to paint or prime the trim unless you are using wood. If using wood, prime the trim now and allow to dry for at least one hour.
Step 3: Nail the trim in place if you are using wood, and if using plastic, apply the glue to the rear of the trim and hold into place while nailing a few small nails. The nails will hold the plastic in until the glue sets permanently. It is not wise to use only nails for plastic trim, because it will cause distortion over time due to weather conditions causing expansion and shrinking of the trim.
Step 4: Use caulk all around the edges of the trim to seal the trim to the window frame. Check all mitered joints and add caulk to these areas as well. If there are any gaps, use wood putty to fill in and then use caulk over the dried putty. This will keep all moisture from disrupting the abilities of your trim to keep out weather. If you choose to paint, paint with an exterior paint and use 2 coats. Allow to dry at least 3 hours between each coat.