To obtain each chaos emerald, you need to beat the appropriate "Sonic Simulator" stages, which you can access from the Sonic shaped ship on the top right of the Zone Select screen.
To unlock all of the Sonic Simulator stages, you need to obtain all 180 Red Rings.
As you need 180 Red Rings to get all of the emeralds, I wouldn't bother with Sonic Simulator you've collected all 180 and then just do them all in one go - should take you less than half hour. Stages that you've beaten are highlighted as opposed to greyed out. If you haven't unlocked a stage, it simply won't appear in the list.
Each Sonic Simulator stage is pretty easy - most stages can be completed in <1 minute. Score/rings do not matter; you do not get a rank at the end of these stages, nor do you get or consume lives. You just need to beat the stage. There are three stages to beat to earn each Chaos Emerald.