How do I prepare walls for painting?

Walls should be clean, dry, and free of loose or flaking paint. Cracks and holes should be filled and sanded. New plaster needs to be fully dry and primed before painting.