Get the Big Stuff Off
You should remove large, flaking bits of old paint first so you can properly dispose of them. To ensure you won’t damage the wood, scrape off the big pieces using a plastic putty knife. If a plastic knife doesn't have what it takes to get the paint off, switch to a metal one, but choose one with a beveled edge rather than a square one. The corners on beveled putty knives are smoothed, so there's less danger of digging them into the wood. No matter what knife you use, be sure to lightly scrape.
Wash the Trim
Before you go after the small bits of peeling paint, wash the trim with hot water and trisodium phosphate or a TSP substitute. This treatment etches the surface, reducing the likelihood of your new paint peeling, and softens the old paint. Scrub problem areas with an abrasive sponge while the paint is wet, but don't overdo it. You don't want to soak the wood, or you could have problems with swelling. Rinse with clean water when you're done.
Scrub With a Toothbrush
If you do any amount of DIY work around your home, save old toothbrushes because they come in handy for jobs like cleaning interior trim. If the old paint you are removing is latex, dip the toothbrush in alcohol first to soften the paint so you can scrub it off with the brush. Use mineral spirits as the solvent for oil-based paint. Work the bristles into carvings and corners, and then wipe the area you scrubbed dry with a rag. Frequently change the solvent.
It's unlikely any peeling paint will survive scraping, washing and scrubbing. But if it does, you can remove it with a light scuff sanding. Use a 150-grit sanding sponge, which is easier to manipulate than sandpaper and won't gum up as easily. Wipe the trim down with a rag, and apply the primer and first coat of paint. A Wagner FLEXiO sprayer will make the job go much faster and produce a more professional finish than a brush. Prior to applying the second coat, use the sponge to scuff up the surface.
Sprucing up trim with paint may take a bit of patience, but you’ll be happy with the transformation.