In reply to Co1in H:
I can't hang around to reply more just now, but I think you are probably asking how to get the CD/DVD drive itself working again after reinstalling your operating system.
Most likely is either that you don't have the right 'driver' (a bit of software which tells your computer and the CD/DVD drive how to talk to each other) installed for it now, or that it has been physically disconnected in the process of installing a new hard drive, and not reconnected again.
Disconnect the mains power, open up your PC, and make sure your CD/DVD drives are properly connected to both the internal power, and to your motherboard - so there should probably be two cables for each drive (there are different types, depending on the drive and on your computer). If they look OK, also try reseating the cables (unplugging them and plugging them in again) - be gentle, some have catches you'll have to release first.
If it's not that, plug the mains power back in and boot up your computer - it's probably the driver which is missing, in which case you'll probably see the drive(s) listed in Device Manager (if you're using Windows) as not working properly.
If so, we need to know what operating system it is (some version of Windows?), and possibly what make/model of CD/DVD drive you have.
You could try searching the net for something along the lines of "Windows 7 driver for Atapi DVD Drive", substituting your operating system and the type of drive, of course. Don't use drivers which don't come from a trusted company; the manufacturer of your drive is probably the best source.
There are other possible problems, such as hardware failure, but these two are the most likely. Good luck!
Post edited at 11:39