Assume the earth is in a circular orbit about the sun.
It takes 1 year for the earth to orbit the sun.
If you know the distance between the sun and the earth and the period of the orbit, you can use Kepler's Third Law to determine the mass of the central object, the sun.
If you would like to see how to do this calculation, step through the the mass of the sun movie.