Use a wood chisel and mallet to loosen and pry the trim loose from its mountings. Cut through tough paint with a utility knife to expose the seams. Use a small flat pry-bar to lever the pieces gently up and away. Tap the piece back down with a rubber mallet carefully to expose the loose nail heads. Pull the nails with locking pliers. This will allow you to remove the piece without the nails causing splits.
Soak the trim in a mineral spirit bath. Fill a plastic tub with enough odorless mineral spirits to cover the trim and allow it to soak over night. The mineral spirits are a natural pine oil and will restore some of the natural moisture to the wood and loosen tough paint.
Brush the piece with a stiff nylon brush to remove loose paint. Allow the piece to dry completely once all paint that can be removed with the brush is removed.
Apply heat from a heat gun to areas of paint that were not loosened by the mineral spirits. Follow the heat gun closely with a thin metal scraper, wearing gloves to protect your hands. Scrape gently, working the old paint off, without raising the grain. Use a piece of steel wool in detail areas to remove stubborn paint. If the piece will be painted, your goal is a smooth surface, not removal of every speck of paint, so use your best judgment as to when to quit.
Apply chemical strippers only in circumstances where mineral spirits and heat will not remove the paint. Brush the stripper on with a disposable brush, wearing rubber gloves, and allow it to work for the recommended time. Scrape the paint and stripper from the piece with a nylon scraper and steel wool. Rinse the surface with mineral spirits and a clean rag to remove the stripper.
Fill any dings in the surface with solvent-based wood filler and a flexible putty knife. Allow the filler to dry completely. Sand the trim in two courses, starting with one pass using 120-grit sandpaper. Work to smooth the grain and any roughness, without rounding corners or sanding away details. Make the second coat with 150-grit sandpaper, sanding in the direction of the grain. Wipe the sanded surface with a tack cloth to remove the dust.
Coat the stripped piece with two coats of boiled linseed oil to restore the woods moisture. Allow two hours between coats and leave the piece to breather overnight before applying paint or stain.
Apply a coat of oil bonding primer to pieces that will be painted. Cover the entire piece, including faces that will not be seen. Use a fine bristle brush, working in long, straight strokes with the grain of the wood. Work to spread the primer as evenly as possible, to prevent runs and drips.
Stain trim that you want to see the wood grain in. Use a fine bristle brush to apply an exterior rated stain in your choice of color, or a third coat of linseed oil for a natural color. Wipe excess stain from the surface with a clean, lint-free cloth.
Apply three coats of semigloss latex paint, or clear wood finish in your choice of sheen. Work with a fine bristle brush in long straight strokes in the direction of the grain. Spread the finish or paint as evenly as possible to prevent runs and drips. Allow the label recommended time between coats and 24-hours before installing. Nail your trim back in place and seal the seams with painter's caulk.