What is the age of the earth and sun?
Scientists know how old the Earth is based on rocks on the surface of the earth using radiometric dating. Isotopes of some radioactive elements decay into other elements in predictable rates. By examining and analyzing rates of current and existing elements, scientists can calculate the number of isotopes in its initial state of existence, then determining the rate of decay, allowing them to know the age of the rock.
To determine the age of the sun, scientists must determine the age of the rest of the solar system since they all formed around the same time, give or take a few hundred million years. Astronauts brought back samples and rocks from the moon for scientists to date. Then with very accurate predictions and a lot of math, they were able to accurately predict the age of the sun.