Remove loose and flaking paint with a scraper or wire brush, sanding the surface and feathering the edges. If the flaking occurs in multiple layers of paint, use of a filler may be necessary. Prime bare wood areas before repainting.
Use of ultra premium quality primers, sealers and undercoats and top coats, should prevent a recurrence of the problem. Using a premium quality acrylic paint on woodwork will give the best results.