One way to force eject a CD from a Mac is dragging and dropping; drag the disk icon from the desktop to the trash can icon on the dock. Alternatively, navigate to Finder and click the eject icon that appears next to the CD.
If Finder fails to recognize the CD or fails to eject it, use applications that handle disks, such as iTunes and Disk Utility. From iTunes, open the Controls menu and click Eject Disk. From Disk Utility, open File, click on the name of the CD, and click Eject from the floating window that appears. Other apps that serve the same purpose include DVD Player and Toast.
If the CD still doesn't come out, try using Mac's Terminal to eject it. To access Terminal, go to Applications, open the Utilities folder, and double-click the Terminal app. Once the app opens, enter "drutil eject". If this command doesn't work, try "drutil tray eject".
If the above measures don't work, eject the CD after a reboot. Restart the Mac and press the trackpad button or the left mouse button until the desktop appears. The disk should eject before OS X loads. Alternatively, restart the Mac and let it rest for a few minutes. The disk should eject itself.