For scratches you can't get out yourself, disc repair services are also an option, though they're rare these days and you may not have one near you. These services use professional-grade machines that essentially buff discs the same way that home methods do, but they can be more reliable. If you're really serious about preserving your discs, you can also buy one of these high-end machines yourself, but since they can run into the thousands of dollars, it's not an option for most people. In most cases, seeking professional repair or buying a disc repair machine only makes sense if you're trying to preserve rare CDs with material you can't find elsewhere.
If you want to preserve the data on your CD and you're not precious about the disc itself, it's a good idea to invest in a CD burner. This lets you copy the data on the disc, keeping it safe even if the physical CD is damaged. Making copies is a good idea, since your CD collection won't last forever. In some cases, a burner may be able to record the data from a disc even when scratches are causing it to skip in your CD player, letting you make another copy later. Like with any repair method, the success of a CD burner depends on how damaged the disc is, but it's a non-destructive way of preserving your CD's contents when it works.