jesu, ne pratis sta nauka kaze
Approximately 4.6 billion years ago, our solar system was just a cloud of dust and gas known as a solar nebula. Gravity collapsed the material in on itself as it began to spin, condensing the matter and forming the sun in the center of the nebula.
With the sun beginning to form, the remaining material started to clump up. Small particles drew together, bound by the force of gravity, into larger particles. The solar wind, a constant stream of charged particles that emanate from the sun's upper atmosphere, swept away lighter elements, such as hydrogen and helium.
This left behind heavy, rocky materials that formed smaller terrestrial worlds like Earth.
https://www.space.com/19175-how-was-earth-formed.html
How do we know the Sun's age?
How do we know how old it is?
We look at the age of the whole solar system, because it all came together around the same time.
To get this number, we look for the oldest things we can find. Moon rocks work well for this. When astronauts brought them back for scientists to study them, they were able to find out how old they are.
https://spaceplace.nasa.gov/sun-age/en/