Formerly sailboat dealer now retired.
First you did not say how deep scratches which is important.
1. If oxidized, I used comet to clean and wash off if needed; otherwise, used Dawn to wash off first.
2, used Finesse It by 3 M compound. Never go over 1000 rpm nor keep polisher in one place or you will burn gel coat.
3. Washed off residue again using Dawn
4. Used cleaner wax by 3M. Wiped off
5. Covered by a good pure wax with UVB inhibitors.
Sometimes I had to do a procedure twice. Worked well for over 30 years