The optocoupler contains one (or two) IR LED as input, and (e.g. in 4N25) phototransistor as output. But existiert with different semiconductors as output: MOC3021 optotriac, MOC3041 optotriac with zerocross switch,analog switch, MOSFET. The big advantage: galvanic isolation up to 2....6kV.