Opto-couplers are used to isolate two power sources from each other while coupling them optically (through light).
For example.
if you have a circuit that runs on 5v logic and there is another circuit running on 24v. You can couple the both circuit optically not electrically. In this way both circuits are protected from each other.