Preparing the surface to be painted is very important. In most cases you can do this by just wiping down the surface with a damp cloth to remove dust, fingerprints or tiny dead insects. If the surface is rough, you should consider sanding it lightly with 200 grit or higher sandpaper. Wipe again to remove dust. Oily marks, crayon or ink can be removed effectively with a light rubbing of mineral spirits. Depending on how bad the marks are, you can spot prime with a shellac based primer to prevent bleed through when it is painted. I run my hands up and down all wall and trim surfaces to detect rough spots and sand them smoothly. You can’t always find them with sight alone.
All nail holes and drywall imperfections should be patched with spackle or joint compound that has self priming formulas. This prevents “flashing” which is when it sucks in the paint making a flat sheen area that stands out when you look at the surface at an angle. The higher the gloss of the paint, the more defects in the surface will stand out after painting. Satin and eggshell finishes appear flat straight on but have a slight sheen at angles. These paints work best in bathrooms and kitchens where spatters and humidity can harm walls.
Once the surface is prepared, you will be ready to have a virtually defect free finish after painting.