Start Device Manager. You can do that by typing device manager into the Start Menu search bar, there at the bottom. It will be listed under control panel.
Find your DVD/CD device in the list and open the listing.
When you see the make and model name of your DVD player right mouse click on it.
From the menu that opens choose Uninstall.
Then from the same menu choose Scan for hardware changes. That should detect your DVD drive again.
Then use the same menu choice and choose Update driver software.
That will give you two choices. Choose Search automatically for update driver software while connected to the internet.
Try a reboot and see if the CDs and DVDs will play.
One trick you can try is cleaning the laser lens inside the DVD player.
You can use a cotton swab and rubbing/isopropyl alcohol. You want it just damp, not dripping.
There are also DVD/CD cleaning kits that might be easier for you to use.