The first part with painting a vanity is a good cleaning. You need to remove any soap scum, etc. TSP, trisodium phosphate, works the best but you can use any good heavy duty cleaner. Make sure to rinse well and allow several hours for drying time.
Now it's time for some sanding. The amount depends on the overall condition of your bathroom vanity. All loose finish or paint must be removed. The goal is to provide a smooth stable base for primer. You can start with 120 grit sandpaper then progress to 150 grit for a nice smooth surface.
Remove any sanding dust with a vacuum and damp cloth.
Priming the entire vanity is next. I like oil base primers for this, they just stick. You can use Zinsser Cover Stain or Original Oil Base Kilz. Both will work well and dry quickly. Usually one coat is enough.
Any repairs can now be done. This includes filling cracks or nail holes. It is best to do the repairs after priming for the best job. That's it for basic preparation of a bathroom vanity for painting. Now your favorite paint can be applied, either oil base or acrylic.