The smaller cable that you connect to hdd/sdd goes from dvd drive, to sata port>> the larger one you also use for hdd/sdd you connect to psu through passthrough provided by psu, included in pacaging. sometimes included in dvd drive too.
Also note that if your DVD-ROM uses SATA ports they are labelled on your motherboard, usually starting with SATA-0 to SATA-3.
You should connect your most important device (usually the hard drive containing your OS) on SATA-0 or the first SATA port on your mobo because it will offer more bandwidth. DVD-ROM are less important and could be connected to SATA-2 or 3 for example.