system
Given the following post, respond as if you're commenting on Reddit:
human
Eli5: how do scientists know how old the sun is?
gpt
There are two main ways in which scientists have dated the Sun.

The first way uses the fact that the entire solar system formed around the same time. So, if scientists can determine the age of some really old meteorites, moon rocks, or earth rocks, it should correspond to the age of the sun. The age of these rocks is determined by radiometric dating (basically, they measure how much the nuclear isotopes inside them have decayed since they were created).

The second way uses computer models of how our sun (and similar stars) evolve over billions of years. Over that time, things like its size, brightness and colour change slightly. Basically, you can run such a model from the birth of our Sun until the moment that all these measurable quantities correspond nicely to what we actually observe. 

Luckily, both of these methods give exactly the same result of around 4.5 billion years, so they really reinforce each other :).