Light year is a measure of distance. Light in vacuum travels at a (large) finite value, $3 \cdot 10^5$ kilometers per second to be almost exact. We can exploit this speed as a function of time. If an object is 5 light years away, it means light must travel at that large speed for 5 years to reach Earth from where it left.
The Sun is about 8 light minutes away. It takes light 8 minutes to reach Earth from the Sun. The sunlight you see is from 8 minutes ago, as it was when it left its source — the Sun.
If there were a telescope powerful enough to clearly see objects hundreds of millions of light years away, and if some hypothetical advanced alien race used such a telescope right now from hundreds of millions of light years away, they would see dinosaurs on Earth since that light had enough time to reach its destination. We aren't visible to them yet because our light is still traveling on its way to destination.