The Sun is about 150 million km away. At such a distance, the light from the Sun takes about 8 minutes to reach us. This is even more surprising as light travels at a tremendously high speed – in fact the highest possible speed there can be. Even then it takes light a full 8 minutes to cross the vast distance between the Sun and us. What this implies is that when you’re admiring a beautiful sunset, what you’re actually seeing has already happened 8 minutes before.
We have not physically measured the distance like one might do using a ruler or measuring tape to measure the length of a room for example. What we’ve had to do is use indirect methods. Trigonometry comes in handy as does using instruments such as radars and other spacecraft.