The 'old' style IDE drives are still available, there should be some good buys around as 'new old stock'. The newer SATA connector drives are more common, but PC builders are tending to not use these drives anymore, as cloud storage becomes more effective.
With optical drives I found they tend to be good for 5 years or so then the laser gets weak and unreliable. Saying that, I use CD and DVD's often, most reliable drives I have are LG multi-disc and an old NEC which is still perfect after 10 years use. If you do buy one check that it is both CD & DVD writer as some are read DVD but not write, aka 'Combi' drives.
You could go the USB DVD route, but note that they can/will be slower than an internal drive.