I have had good results from using a couple different things...

First, a scratch at goes all the way through to the metal or plastic is not going to buff out with a quick swipe of a cloth. For that you can go to most auto parts stores and buy a color matched paint pen/brush in a small bottle. They usually cost about $5 and the pen tip makes it easy to fill in the scratch by just tracing the line. Once it has dried fully you will need some polishing compound, the stuff that comes in the little plastic tub and is a thick red paste. Rub the area until it looks smooth again. Then there are two things that will help. NuFinish car polish or Meguiars Color RX. These do well to help blend the area into the rest of the paint. Once those are on use a good wax over the whole bumper, fender, or whatever panel the scratch was on.

Second, if the scratch is only in the surface and does not go through. Skip the touchup paint step and start with the polishing compound as described above. Follow with one of the two liquid polishes above and then wax

And last if it is just a minor scratch that barely marked the surface but is still plainly visible you can skip to one of the liquid polishes but be aware that after a couple rains or washes the scratch may be slightly visible again.

For most normal scratches the second step is going to be the best. This is a good process to use over the entire painted area of the vehicle because it will help to smooth the finish and then the wax will work better at keeping dirt off.