This video shows how to fix the tray of a CD or DVD drive when it does not eject after pressing the eject button. Most of the times this problem is caused by a dried rubber band in the eject mechanism. Open the drive, replace the rubber band, and that’s it.
The rest is here:
How to fix a DVD drive’s tray that doesn’t open or eject