Light and electromagnetic waves travel through a medium called the 'luminiferous aether' that fills all space.
Light does not require a medium. Einstein's special relativity (1905) and the Michelson-Morley experiment (1887) disproved the aether.
What changed?
Nineteenth-century physicists faced an apparently airtight argument. Sound is a wave, a vibration that travels through air. Water waves travel through water. Every wave anyone had ever observed required a medium, some material substance through which the disturbance propagated. Then James Clerk Maxwell's equations of electromagnetism, published in 1865, revealed that light was an electromagnetic wave. The question followed immediately: what medium does light travel through?
The answer was the luminiferous aether, a transparent, weightless, perfectly elastic substance that permeated all of space, including the vacuum between the stars, the interior of glass, the space inside atoms. It could not be seen, felt, or detected directly, but it had to be there. Waves require a medium; light is a wave; therefore light has a medium. The logic seemed unassailable.
Albert Michelson and Edward Morley decided to measure it. If the aether exists and is roughly stationary while the Earth moves through it, Earth's orbital velocity, about 30 kilometres per second, should create a detectable "aether wind." Light travelling in the direction of Earth's motion should have a slightly different speed than light travelling perpendicular to it, in the same way a swimmer going with the current is faster than one going against it. Michelson built an interferometer sensitive enough to detect velocity differences far smaller than Earth's orbital speed. In their 1887 experiment in Cleveland, Ohio, Michelson and Morley measured the interference pattern of split light beams oriented in different directions and looked for a shift as the apparatus rotated.
There was no shift. None. The speed of light appeared identical in all directions, regardless of Earth's motion. The result was so unexpected that Michelson himself thought something had gone wrong. The experiment was repeated, refined, and replicated many times over subsequent decades. The answer never changed.
The crisis produced some remarkable responses. Hendrik Lorentz and George FitzGerald independently proposed that matter physically contracts in the direction of motion, just enough to hide the aether wind. The "Lorentz contraction" was mathematically correct but physically baroque: an entire universe of matter constantly squishing itself to conceal an invisible medium.
Einstein's 1905 paper on special relativity dissolved the problem by removing its premise. Instead of trying to explain why the aether couldn't be detected, Einstein simply dispensed with it. He took as a postulate that the speed of light in a vacuum is constant for all observers, regardless of their motion or the motion of the source. No medium was needed, and no medium was assumed. The entire framework of aether physics became unnecessary overnight.
The aether lingered in physics classrooms for decades, partly because old textbooks don't rewrite themselves, partly because the concept is intuitively easier to grasp than the relativistic alternative. But it was gone from serious physics by the 1930s.