How do scientists measure a lightyear?
A light year is the speed of light multiplied by the duration of one year. So you need to know what it is the speed of light and how much is a year.
Scientist have endured during several centuries for determine the velocity of light. Now they know it so well, that the definition of the meter depends on it . The meter is defined that the speed of light is exactly 299 792 458 m / s. How much is a year? It depends, it can be 354 like the muslim year or 360 like maya year. The year chosen was the medium julian year (365.25 days) which is the one of our calendar, by having leap years each four years, excluding the gregorian corrections.
So one light year is by definition (not measured):