Here is a video that shows you how to attach a socket to a ribbon cable.
If you are putting sockets on both ends, be aware that there are two ways you can add the second socket. It can be the same way up as the first one, or the opposite way up to the first one.
Use the same way up if the cable is running straight from one circuit board to another.
Use the opposite way if the cable is running from a board on top of the robot to a board on the bottom of the robot. e.g. the line sensor board which fits underneath the robot.