|"Tried to play a cd but nothing happened."|
What do mean by that ?
It doesn't play or autorun the disk, or it doesn't recognize any disk is there ?
Autoplay or autorun can be "broken" in Windows and yet you can click on files on the disk in My Computer or Windows Explorer and they will play or run fine.
(Sometimes you can only do that in Windows Explorer - All Programs - Accessories - Windows Explorer - open up My Computer - click once on the CD or DVD drive the disk is in.)
"It's a desk top by the way."
There is a small rubber belt just inside the front of the drive that can slip or break and that will prevent the tray mechanism from ejecting or retracting, but usually that doesn't happen until the drive is many years old. You can see it when there is no disk on the tray below the tray through the holes in the tray.
Rarely, the plastic cone or whatever that holds down the disk while it's spinning can break loose. That can get in the wrong place and jam a disk and prevent it from spinning. I have fixed several drives with that problem by removing the drive and removing the top cover from the drive and gluing that accurately in the place it's supposed to be, with epoxy glue.
If the drive has been used a lot ........
The most common cause of CD drive death is the spindle motor has seized, or is spinning so slowly the circuit board on the CD drive, or Windows, "thinks" there is no cd.
To check for this, insert a CD in the drive, and note its position. Close drive. Try to access the drive. The led should turn on. Eject the cd after led has gone out - if the cd is still in the same place, the motor is seized.
Alternately, with computer on, insert a cd into the drive, noting its position - when the cd is inside the drive, the led should come on - give it a bit of time, then eject it - if the cd is still in the same place, the motor is seized.
If the CD has moved, but the computer still doesn't find it, it may be spinning too slowly. The only way you can check for this is to remove the CD drive, take the top cover off, then connect the drive and attempt to access the CD, and watch how fast the cd spins - if it takes a while to start spinning, and/or spins very slow, the motor will soon seize. You could also remove enough hardware above the cd spindle so you can attempt to spin the cd with your finger, place a cd on the spindle (be careful - there will be nothing to hold down the cd), attempt to access the CD, and gingerly try spinning the cd faster with your finger, then let go - it may then acheive its proper speed - it may then be recognized.
If your CD does not spin, or spins too slowly, it's time to get another CD drive. I have never seen a CD spindle motor that has ball bearings - they all seem to have sleeve bearings. You MAY be able to get it to run for a short while by removing or getting access to the motor and oiling it, but it is a waste of time - it will seize again (been there, done that - the oil improved the situation, but was not enough).
Other things that can cause the bios while booting and Windows to not detect a disk in the drive....
It is common to un-intentionally damage IDE data cables, especially while removing them - the 80 wire ones are more likely to be damaged. What usually happens is the cable is ripped at either edge and the wires there are either damaged or severed, often right at a connector or under it's cable clamp there, where it's hard to see - if a wire is severed but it's ends are touching, the connection is intermittent, rather than being reliable.
Another common thing is for the data cable to be separated from the connector contacts a bit after you have removed a cable - there should be no gap between the data cable and the connector - if there is press the cable against the connector to eliminate the gap.
80 wire data cables are also easily damaged at either edge if the cable is sharply creased at a fold in the cable.
Try another data cable if in doubt.
80 wire data cables must have the proper end connector connected to the mboard IDE header - usually that's blue, but in any case it's the one farther from the middle connector on a 3 connector data cable.
Check your SATA data cables. The connector on each end should "latch" into the socket on the drive and on the mboard, or on the drive controller card - it should not move when you merely brush your hand against it near the socket - if it does, mere vibration can cause a poor connection of it - use another SATA data cable that does "latch", or tape the connector in place.
(There is a slight projection or bump on one side of the outside of the connector that "latches" it into the socket - it's easily broken off or damaged)
The same thing applies for the SATA power connection.