Disassemble the crib back to the original form it was when it arrived at your home. Most cribs come in flat boxes and are put together in the home. If you dismantle it to this stage, you can easily reach all the parts of the crib for painting. How much it will dismantle will vary from crib make to crib make. Set the crib on a dropcloth to protect your flooring.
Sand the crib with fine sandpaper to roughen the surface, allowing the paint to adhere better. Use sandpaper or a sanding sponge and work by hand. Electric sanders won't allow you to reach all the small places in between the rails and can damage the wood.
Wash the crib with trisodium phosphate (TSP) and a sponge to get rid of the sand dust and any other residue. Rinse with water and dry thoroughly.
Apply a primer to the crib. Use a non-toxic primer with low amounts of volatile organic compounds (VOC). These are easier on the air qualify and won't harm the baby if he chews on the rails. Apply the primer with a paintbrush or painting sponge. You'll need a small brush to work between the railings. Allow the primer to cure according to package instructions before proceeding.
Paint the crib with your chosen paint color. Use a latex paint with low VOCs that is non-toxic. Use a small paintbrush or sponge to reach the tight spots. Allow it to cure completely before applying a second coat if desired or putting it back together.