Peeling paint can be repaired successfully only after addressing the reason it lost adhesion: moisture, poor preparation, contamination, or incompatible layers. Painting over loose edges may look better briefly, but it does not stop the failure.
Look for moisture before sanding or repainting
Staining, soft drywall, bubbling, or peeling near a bathroom, window, or pipe can indicate moisture. Fix the leak or condensation source and let the substrate dry before repairing the finish.
Remove paint that has already lost adhesion
Scrape loose edges back to firmly bonded material without stripping sound paint unnecessarily. In older homes, existing coatings may contain lead; avoid dust-producing sanding or scraping until you understand the applicable lead-safety requirements.
Feather edges and prepare the surface
Repair small defects with a compatible compound, sand lightly only when safe, and remove dust. An appropriate primer helps when the substrate is porous, stained, or the previous coating had poor adhesion.
Repaint only when the substrate is stable and dry
Follow product drying times and temperature and humidity limits. If paint peels again in the same place, investigate moisture or substrate movement instead of adding another coat.