Optical fibers function by transmitting light signals through their core. The light is kept within the core by a principle called total internal reflection. This enables the transmission of data over long distances with minimal signal loss, making optical fibers an efficient medium for data communication. The technology has revolutionized various fields, including epidemiology, by facilitating rapid data collection and analysis.