An optical modulator is a device that modulates or varies the amplitude, phase, or polarization of an optical signal in a controlled manner. It generates desired intensity and color in light by changing optical parameters like transmission, refractive index, or reflection according to a modulating signal. Optical modulators are used when directly modulating a laser would cause issues like frequency chirp or loss of information. There are different types of optical modulators including acousto-optic, phase, polarization, and amplitude modulators that work using various effects like Pockels or acousto-optic. Modulation can be done directly on the laser by changing its current or externally using a separate modulator.