I have this computer I'm fixing up to try to sell and the tray won't open. You can hear and feel (with your hand on the tray) the drive try to open, but it never will, and eventually it will just give up, try to pull it back in, and check for a cd. What could be my problem here? This happens once in a while with my other computers too.
Trying opening it manually with a straightened end of a paperclip - you'll find a little notch / opening on the tray for doing just that. Make sure the power is off, obviously, when you do it. Leave the drive open and hope it resets when you power up again. Failing that, replace it with another one.
How many years old drive is it ? Try to pat the top of the bay where the drive is fixed it might help .. Helped me when my drive did not come out from my Desktop