Clean any soiled areas, efflorescence stains or rust stains. Use a mild masonry soap and start from the top of the wall and work your way down.
If you use a pressure washer, use minimal pressure and a wide spray, since stucco can be damaged by high pressure. Keep the nozzle at least 12 inches from the surface, and angle the nozzle away from windows and doors so it doesn't damage the stucco at the edges.
Seal all cracks and gaps to prevent water running behind the paint. Small cracks can be sealed with regular caulking, but larger ones will require an elastomeric brush-grade caulk. Apply this in two coats and let dry thoroughly after each.
Remove any damaged stucco and repair it with a patching compound. Chip away the damaged stucco and wash with water and a wire brush. Let dry, then apply the first coat of patching compound. This coat should be level with the surrounding stucco. Apply the second coat of patching compound, matching the texture with the surrounding stucco. This can be difficult, and the repaired area will likely look a little different.
Prime the stucco with an acrylic primer designed for masonry.