To collect all seven Chaos Emeralds, you first need to gather every one of the special rings scattered throughout the game.
Once you have them all, you'll gain access to a special stage. Inside, your task is to collect 300 rings, and doing so rewards you with a Chaos Emerald. Repeat the process until you've secured all seven.