If you can’t eject it by using the eject button in iTunes, hold down the mouse button when you restart your Mac. That should kick the CD out. And on a MacBook, you can hold down the trackpad clicker as you restart.
And if that troublesome CD was any other size than a full size CDs, that might have been the problem. The smaller, odd shaped CDs are bad news. If it was a full-size, burnable CD, it could be warped or other wise damaged. I’d not use it again.
If you continue to have problems ejecting CDs, see this page at Apple: Troubleshooting the slot load optical disc drive. It gives more information and shows how to reset the power management unit to fix a reoccurring problem with stuck CDs.