Is this a desktop computer ? Is this a new problem with a drive that worked previously ?
If so open up the computer and see if the drive cable has come loose at the drive or the motherboard.
Some of these suggestion also apply to laptop computers.
Check the BIOS screens to see if the drive is being recognised there but not in Windows.
Check Windows Control Panel, System, Hardware, Device Manager to see if the drive is present or yellow flagged as faulty.
If it's a laptop computer with removeable drive bays, check that the CD drive is inserted fully.