You have to match the existing finish to remove scratches. If the finish is 400 grit, then you need to use a 400 grit abrasive. Anything finer will make the polished area too shiny. Practice with different abrasives on scrap metal until you find a match. If the scratches are on a blasted area, such as the top of the slide, that area would have to be blasted with a matching grit.
It might be best to just get used to fine scratches and use marks.
All the posts about shining your gun up with Mothers polish do not answer the question properly. Not everyone wants their gun shiny.