1. Pry off the damaged brick molding with a flat pry bar. Repair any siding damage behind the trim. Also replace any deteriorated building paper.
2. Cut a piece of new molding slightly longer than the damaged piece. Cut to size and test-fit the replacement piece.
3. Miter-cut new brick molding pieces, prime and paint them to match, and nail them to door or window framing with 16d galvanized casing nails. Apply a bead of construction adhesive to one of the mating ends before making each joint. Set the nail heads and fill the nail holes with exterior wood filler.