Plastic is everywhere--from polyvinyl chloride, or PVC, used for pipes, vinyl siding, toys and food or detergent containers to different plastics used every day in diverse items such as electronics housing, helmets, auto parts, sippy cups, garbage cans, toothbrushes, shower curtains and even clothing.
Consider what sort of use your project will get. If you are spray painting your basement ceiling and want to coat all the PVC pipes with the same color paint, you don't need to use a special primer or paint. Latex ceiling paint will adhere just fine, since presumably the pipes in your basement ceiling will never be handled or exposed to weather. On the other hand, you must paint plastic outdoor furniture properly, so it will withstand handling and weather exposure.
Like most glossy surfaces, plastic that has a hard, smooth surface should be cleaned and sanded before you apply any primer or paint. Use very fine sandpaper or a sanding sponge to rough up the surface. The Paint Quality Institute recommends 220-grit garnet sandpaper, followed by wiping down with a clean rag.
You can paint some plastics, such as smaller projects or crafts, easily with aerosol spray paint designed especially for plastic. Available in most paint and craft stores, plastic spray paint comes in a wide variety of colors. Solvent-based finishes, such as oil- or shellac-based primer and paint, tend to adhere very well to most plastics. Paint vinyl siding and trim with 100 percent acrylic house paint. You can paint most plastic with water-based paint if it's primed first with the right primer. Look for "bonding primer" at paint and hardware stores.
A lot of plastic is somewhat flexible, and if you want the paint job to last, use flexible, high-quality paint. Inexpensive paint becomes brittle and does not flex without cracking, and won't last as long.