If possible, determine the cause of the peeling paint to prevent the new coat of paint from peeling as well. Peeling paint does not always have an obvious or preventable cause. For example, paint can peel if it is simply old or if too many layers of paint have been applied to a single wall over many years. However, specific undesirable conditions can also cause paint to peel. Combinations of non-compatible paints -- for example, alkyd and latex -- can cause poor adhesion. Water leaks can also cause poor adhesion of paint to the wall.
Scrape loose pieces of paint off the wall using a scraper. Remove nails, light covers, outlet covers, smoke detectors and other removable parts from the wall. Fill any holes with spackling and scrape off the raised edge of spackling with the paint scraper. Wait for the spackling to dry according to the instructions on the can.
Sand the repaired areas and areas where paint was scraped off using 160-grit sandpaper. The purpose of sanding is to making the surface of the wall as smooth as possible. Some types of paint show imperfections more than others. For example, glossy paint -- most often used in bathrooms -- shows surface imperfections much more than an eggshell paint. When the sanding is finished, clean the surface of the wall using a tack cloth.
Priming the walls is the last step before painting. Primer will help seal the walls while creating a fresh blank surface for your new coat of paint.