Clean the trim with trisodium phosphate and a rag.
Sand off glossy trim finishes using 220-grit sandpaper. If your trim is coated in a glossy finish, the paint will have trouble sticking to the surface. A piece of 220-grit sandpaper abrades the surface enough to accept paint, but it isn't rough enough to damage the trim surface.
Lay plastic tarps on the floor to protect against paint drips.
Apply painter's tape to the wall surfaces bordering your trim. Painter's tape protects nearby surfaces from stray brush strokes.
Prime untreated trim with general purpose primer.