Optocoupler to create galvanic isolation between 2 circuits
What is a photo-transistor? On one side, there is an input circuit made with a emitting diode which produce light when a current is flowing through. The other side is made with a photo-sensitive transistor which allows the current to flow to the base when light hits the transistor.
When the transistor is in commutation, the current flows from the collector to the emitter. As it is a transitor, there is also a voltage lost Vce(sat) between the emetter-collector of about 0.25V with the optocoupler. This transistor is working as an "open collector" transistor, it wire the circuit to the ground.
You also have a place a resistor to limit the current through the light emitting diode. The diode also have Forward Voltage characteristic (VF, typically 1.25V) and a maximum current of 60mA.
Here is a typical usage schema...