I *think* you are talking about the sensor?
If so, then I think a description of how it works is better than a simple 'hook wire A to terminal B' type of answer.
These type of sensors are quite simple. They work by shining a light at a photosensitive 'receiver', which is just a switch that turns on when you shine a light on it. Note that the light is in a range not visible to humans.
The light source is on one side and the 'switch' on the other side. Between those goes your shutter wheel, a tab on your mill table. etc. This breaks the bean and turns off the switch. When you remove the obstruction, be it a tab attached to your table or a hole or slot in a shutter wheel, then the light reaches the switch and it turns on. That's all there is to it.
So you have a power and ground on the light source side (sometimes, but not always red and black). You have to obey the rules on this as you would with any other LED. You MUST restrict the current to a level that is tollerated by the LED or you will burn it out. In the case of the referenced sensor, if you feed it with 5V, then you need between 100 and 150 ohms resistor in the wire to 'slow down' the juice to a level that keeps the LED healthy. This resistor can be anywhere in either the positive or negative wire and the value is not super critical.
The receiver side has sometimes (but not always) a green and a white wire. Since the device burried in the sensor and attached to these wires is just a switch, you don't need to be so careful. If you are only feedijg a pin on a BOB, just do not exceed the sensor's volatge spec and you are pretty much golden. The switch does have polarity, meaning that the power will only flow in one direction, so if you get it hooked up backwards, it won't work. Good news is it probably won't be damaged so just reverse the wires.
TIP: with the light side powered up and no obstruction, the switch should be ON. You can check this with an ohmmeter, continuty tester, etc. Put the probes on each way and you will get continuity in one direction and not the other so you will be able to see which way to hook it up. A catalog cut (spec sheet, data sheet, etc) also will define which wires are for what purpose.
Hope this helps.