Many cosmetic defects on the paint can be repaired by just polishing or minor touch up, saving you the trouble of repainting the car. If the scratch is only visible under light and you can't feel it with your fingernail it's easily repaired. If you see primer or bare metal it cannot be fully repaired, just made less noticeable. In many cases, it can be polished to the point where only you'll notice it.
If you're not sure, start with the lightest treatment and see if the results are satisfactory. Only then should you use more abrasive and aggressive treatments. Remember that it might not be possible to erase the scratch completely. First try to reduce the appearance of the scratch, then decide from there if it's worth it to remove more material.
Using touch up paint (for heavier scratches)
If the scratch is still noticeable but doesn't go down to the primer, I would just leave it alone or try using the rubbing compound again.
If the scratch does go down to the primer and you have determined that you want to use touch up paint, remember that it might look more noticeable with a messed up repair than before!
First wash and dry the area. Use some 1500-2000 grit wet/dry sandpaper, and using water to lubricate the sandpaper, sand the edges of the scratch slightly. I suggest using a small piece of sandpaper and folding it around a pencil or stick to isolate how much of the area you are sanding. You just want to rough up .5 cm around the scratch, not the whole panel. Follow the same basic idea as 1000q: paint chip repair, but instead of filling a chip you are filling a scratch.
You can also try taping off the area around the scratch so only the area you want to sand is exposed.
Wipe the area clean with rubbing alcohol to remove any traces of oil and dirt.
Never use the paintbrush in the bottle of touch up paint. It will leave large blob if you do. I suggest using a thin piece of wood or tiny, very thin tapered tip disposable paintbrush to apply the paint.
Don't worry about filling the corners, the paint will spread out due to capillary action. Give it 5 minutes and apply again. Repeat. You want the paint to fill in the scratch so that it is raised above the rest of the paint. Remember that as the paint dries, it will shrink down, so make sure to overfill the scratch sufficiently!
After a day or two of drying time, you can now sand it down with the same 1500-2000 sandpaper. Your goal is to even out the surface of the repair with the surrounding paint.
Silver and any pearls or metallic paints in general are more difficult to match. You may want to make the last few coats of touch up paint a clearcoat to help make it match. If you have a white pearl or light metallic, it will be pretty much impossible to match the paint flawlessly. Even a professional can never perfectly match a white pearl, so set a reasonable goal.
Non touch up paint treatments (for lighter defects)
If you can only see scratches under certain light or angles, use some polishing compound and a porter cable polisher to lightly reduce the appearance or try to eliminate it. If it is severe, you can try using a light rubbing compound to test if this reduces its appearance. I recommend 3M finesse it or turtle wax rubbing compound for machine use (it comes in a green plastic squeeze bottle, not the red compound in the white plastic can)!
First wash the car.
If your fingernail catches on the scratch, you need to use a 2000 or higher wet/dry sandpaper followed by strong polish or light rubbing compound. The sandpaper will smooth the edges and remove some material and the polishing compound will remove all the fine scratches from the sandpaper. You could use a mother's powerball mini or powerball for paint with a light polish. The powerball mini is a stronger foam and will leave some minor marks so you need to follow up with polishing afterwards. See 1000q: car detailing - polishing your paint for more details.
Here are some before and after pictures of a paint scratch. Someone inconsiderate person put a dirty heavy object on the hood of my car and dragged it across.
It's hard to pick up scratches with a camera unless the lighting is just
right but I assure you the scratches were very noticeable in perosn.
Halfway through polishing most of the scratches are removed. Here I
wiped away most of the polish to identify the deepest scratches which needed
more work and concentrated on those.
The final results. The deepest scratches are still visible but only
from the right angle and right light.
Here is another angle showing the scratches from another angle. They
are invisible. There was a dent but it can be repaired later.
Here is the same car after a kind person with a handtruck left their mark. This scratch was wide and down to the primer and could not be fullly repaired, only made less noticeable. The only way to completely repair this defect would to spend hundreds at a paint shop repainting the entire upper panel.
After polishing, the scratch is still visible but the scuff mark below the handle is gone and the lines of the scratch aren't as strong.