Electrical signals can be converted into optical signals by using a device called a modulator. A modulator converts an electrical signal into an optical signal by varying the intensity of a light source in response to the electrical signal. This allows the optical signal to carry information, which can be transmitted over fiber optic cables and then converted back into an electrical signal at the receiving end.