Optical switches operate by redirecting light paths through various mechanisms, including mechanical movement, electro-optic effects, or thermo-optic effects. At the nanoscale, these switches leverage unique properties of nanomaterials and nanostructures to achieve high-speed and low-power switching.