Please turn off the computer, remove all peripherals such as printer, speakers, external drive ,wait about 3 minutes and then power on computer. Hopefully you're able to eject CD from the computer now.
If the troubleshooting step above doesn't fix the issue:
Please check to see if there's a small hole by the CD /DVD drive. If there's a hole, use a bent paperclip, or needle to push the button to see if that will open the CD/DVD tray.