A light-year is a unit of distance, not time, defined as how far light travels in a vacuum over the course of one year. Since light moves at about 300,000 kilometers per second, a single light-year works out to roughly 9.5 trillion kilometers, a number too large to comfortably use kilometers or miles for.
Astronomers use the light-year because ordinary distance units quickly become unwieldy at cosmic scales. The nearest star system to our sun, Alpha Centauri, sits about 4.2 light-years away, while our entire Milky Way galaxy stretches roughly 100,000 light-years across.
Because light takes time to travel, looking at distant objects also means looking back in time. A galaxy that is 10 million light-years away is being seen as it looked 10 million years ago, not as it looks right now, since that is how long its light took to reach us.
Scaling up from a single star system to the wider universe makes the light-year feel small again fast. The Andromeda galaxy, our nearest large galactic neighbour, sits about 2.5 million light-years away, meaning the light reaching telescopes tonight left it well before modern humans existed. The observable universe as a whole stretches roughly 93 billion light-years across, a number that sounds like it should contradict the universe’s 13.8 billion year age, but does not, because space itself has been expanding the entire time that ancient light has been travelling toward us. A parsec, another common astronomical unit based on how much a star appears to shift as Earth orbits the sun, works out to about 3.26 light-years, and the two units are often used interchangeably in casual writing.
The first reliable stellar distance ever measured came in 1838, when astronomer Friedrich Bessel used the tiny apparent shift of a nearby star against more distant background stars, a method called parallax, to calculate its distance in light-years for the first time. That same basic technique, refined enormously by space telescopes like Gaia, remains the most direct way astronomers measure distance today.