Painted trim in your house accumulates a film of dust, like any other interior surface, even if it's in a rarely-used room. If you have a busy home, trim can get quite grimy, especially around door handles, on painted cabinets and baseboards. Gloss paint is much easier to clean than flat or eggshell paint; the higher the gloss, typically the more durable and washable the painted surface. Using mild cleansers, even latex (water-based) gloss paint can be cleaned effectively.
Fill a bucket with soapy water, using mild dish-washing detergent or a general purpose cleaner.
Fill a second bucket with clear water for rinsing. Put drop cloths or old towels below the area you're going to clean.
Starting at the bottom of whatever you are washing, use a sponge to wash the painted trim. The Old House Journal suggests using a natural sea sponge instead of a synthetic one. Working from bottom to top prevents dirty water from running down and soiling the lower areas.
Rinse the surface from the top down, using your second sponge and the bucket of clean water.
Buff the surface dry with clean dry rags or paper towels.