I did on my last boat. Days and days of prep - sand and fill, sand and fill. Then a first coat of primer, which showed up all the bits I'd missed, so back to sand and fill. Next coat of primer. Bugrit I still missed some bits! Decision time - live with those bits that are less than perfect or go round again? Finally 2 pack paint, can't remember which one, roll and tip (google it - they'll explain better than I can), two coats.
It looked great and didn't cost the earth. When I sold the boat 15 years later, it really needed to be done again.
Top tip Don't change the colour or every little scratch will show, and there will be little scratches!