Using an optical switch with 5 terminals as a sensor
The anode and cathode are the terminals of the IR LED, which produces the IR light that the detector portion of the device detects.

The Electrical Characteristics table on page 4 of the datasheet gives the characteristics of the IR LED.  The LED has a typical forward voltage of 1.7 volts, at 20 mA.

As with any other LED, the IR LED must be connected to a suitable power supply, with a series resistor to limit current.  For a 5 volt power supply and 20 mA LED current, you require a resistor of about 165 Ohms - the value is not highly critical - 160 or 180 Ohms would be fine.