In the movie, when Buzz Lightyear is introduced to Woody, he tells him that he's "the coolest toy ever." The character was originally created in the 1980s as a toy for a new line of Space Ranger toys.
The name "Lightyear" is a reference to the unit of measurement that defines the distance travelled by light in one year.In the 1980s, toy company Mattel was looking for a new toy that would be able to compete with the latest and most popular toys of the time, like He-Man and Transformers.
After a lot of brainstorming, they came up with an idea - a space car that could fly through space and do all sorts of cool things. The name "Lightyear" was chosen as it is the distance a light beam travel in one year and they decided to do a movie later on called lightyear.