First, click on the My Computer folder, and when it opens, right-click on the icon referring to your CD.
On the pop-up menu, click on Eject.
If that does not work, click on the Ctrl-Alt-Delete keys simultaneously once.
In the Close Program box, check for a reference to a program accessing the CD -- a game or a music player, say. It may still be running, even though you may think you closed the program.
If it is running, highlight the reference, then click the End Task button.
As a last resort, shut down the computer. Look closely at the front of the CD player. You may see a teeny hole. Undo a paper clip and, gently, stick one end into the hole until the CD drawer pops open part way. Pull it out and remove the CD.
If the trouble is happening when you are playing a game, uninstall the game program and then reinstall it. A program corruption may be holding the CD hostage.
If the PC is several years old, you may have to replace the CD player. Mechanical parts of PCs are often the first to go.