Fill nail holes with spackle or carpenter's wood putty. Allow it to dry, sand it smooth with 120-grit sandpaper or a sanding sponge, then wipe the dust from the trim.
Prime raw wood trim with one coat of oil- or water-based primer using a 2- or 3-inch brush. Allow the primer to dry.
Sand the primed wood lightly until it feels smooth.
Caulk all gaps and joints. Squeeze a line of caulk along each gap, then wipe it smooth with a damp rag or your finger. Also caulk the gap where the wood trim meets the wall.
Paint the trim with two coats of quality paint in a satin or semi-gloss finish. Modern water-based paints rival oil-based enamel in durability and smoothness. Water-based paints are also easier to use and dry faster, with less odor.