system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How do we know that the sun was formed around 5 billion years ago?
gpt
There are various methods, such as using computer models of stellar life cycles, but the most tangible way is simply that we know that other things that probably formed around the same time as the Sun were formed around 5 billion years ago.

It's likely that the entire solar system (the Sun and the planets) formed at roughly the same time, so to approximate the age of the Sun, we can take a look at the age of objects in our solar system.  The oldest meteorites we've found are approximately 4.6 billion years old, according to radiometric dating; round that up to 5 billion and there you have it.