|The laser lens may be "dirty".|
Try using a laser lens cleaning CD in the drive. If you don't have one you SHOULD have one. Most places that sell CDs or DVDs sell them, and even some "dollar" stores have them for a buck or two.
Or, if this is a laptop computer, eject the drive's tray and with no disk on the tray, wipe off the obvious laser lens with a tissue or a soft cloth.
If that doesn't help.....
If this is on a laptop computer, if the CD drive is a module that plugs into a bay and is swappable with other devices that can plug into the bay, make sure that it's all the way into it's bay.
Optical (CD, DVD) drives do not remain usable forever.
If you haven't been fiddling with the connection(s) of the drive, or the jumpers on the back of the drive if it's IDE, inside a desktop case, then the thing that usually causes an optical drive to become unusable first is the motor's cheap sleeve bearings have deteriorated to the point that there is too much friction and either the motor can no longer spin a disk at even 1X speed (the original audio CD speed) or the motor does not spin at all.
If the motor can no longer spin a disk at even 1X speed (the original audio CD speed) or if the motor does not spin at all, then the mboard's bios and Windows cannot recognize that there is an optical disk inserted in the drive.
NOTE that a CD-rom drive - only reads CDs - , or a CD-RW (burner) drive - only reads or burns CDs , CANNOT recognize ANY DVD disk .
People often call an optical drive a CD drive or a CD-rom drive when it's actually more sophisticated .
DVD burner drives - can read and burn both CDs and DVDs - have at least two lasers and associated circuits - sometimes one of those malfunctions after the drive has been used a lot - in that case it may then not be able to read one of ANY CD, or ANY DVD