It is impossible to take out a ruler and measure the distance of the Earth from the sun. Unless, of course, you somehow manage to invent a suit that can survive the temperatures of the sun and design a ruler long enough to measure such a distance. However, it would likely take you a very long time to measure such a distance anyway.
Instead, astronomers use estimates and mathematical theories to devise their best guess to just how far items in the universe are away from each other. This is why when you read a news report that a star will likely be going supernova “any day now,” you have to understand that “any day now” could mean tomorrow, a year from now, or even ten thousand years from now.