There are two methods - both involve creating a key for the new paint. The first is to sand it with fine wet-and dry papers or fine wire-wool (very efficient - but use a magnet to pick off the loose steel fibers afterwards) the second is to use a chemical keying agent. These are advertised as painting preparation 'makes paint stick to any surface'. Personally, I'd just give it a light sand to take down the high spots and key the surface. If the paint is sound and not flaking just paint over the top of it. Bare wood and filler will need spot-priming and undercoating. You should probably read my hub on how to paint a door.