An Optocoupler is a combination of LED and a Photo-diode packed in a single package. As we can see in the below-shown circuit diagram, when a high voltage appears across the input side of the Optocoupler, a current start to flow through the LED. Due to this current LED will emit. An optocoupler, also known as photocoupler or opto-isolator, is a device which can transfer an electrical signal across two galvanically-isolated circuits by way of optical coupling. They use light to pass signals between circuits.
We know from our tutorials about Transformers that they can not only provide a step-down (or step-up) voltage, but they also provide electrical isolation between the higher voltage on the primary side and the lo.