It would help to know if you drives are SATA or not, but on the off chance that the aren't here goes.
Most hard drives, CD and DVD drives have a IDE cable which attaches them to the motherboard which usually has two connectors for these. These motherboard connections are usually labeled a and b or 1 and 2, the hdd should go in the a or 1 by itself. This
link will take you to a diagram of a IDE cable and its proper installation. The connector and the cable will only go together one way, but you can put the IDE cable in backwards. If you look at the cable you will see that two of the connectors are closer together at one end, these are the connectors that go to the drives. There is a red line on one side of this cable which designates its connection to pin one, I know someone would have been disappointed if I hadn't added this.
The CD and DVD drives will share the same IDE cable and will attach as shown in the link that was provided. On the rear of the CD and DVD drives looking from right to left you will first see four larger pins, these are for the 12V power connector, next is the IDE connector pins, after that there are six pins, three on top and three below, these are the jumper pins, these set the drive for master, slave, and cable select. There should be a jumper connecting one of the upper and lower pins. The drives will be connected as master and slave to the IDE cable and the drives will need to have the jumpers set to master and slave matching their location on the IDE calbe. If there isn't a diagram of the pin configuration you may have to google you drives to find out how the are set. Most a master, slave, and cable select from left to right, but check to be sure.
The only connection left is the power, there is a four wire connector with two black wires and a yellow and red wire. If you look at the plug the corners on one side are rounded, this is the top side. This connects to the four larger pins on the right side looking at the rear of the drive.