Working by hand, I can usually get right up beside trim. I'll sometimes use a piece of thin, coated cardboard (like the stuff that comes in packages of women's pantyhose) as a shield, holding it up against the trim. Otherwise, use the masking tape or use products that don't stain trim.