A number of ideas are based on the size of the sun, and the distance between the sun and the earth.
The distance to the sun is (according to the globe model) 149.597.870 km and the diameter of the sun itself 1.392.000 km. These are numbers that are actually mind blowing.

How do and did they calculate these vast distances, as you cannot take a simple ruler to measure it?

Distances can be calculated by triangulation. For instance

When the height of the tower is 70m, and using a theodolite (an instrument to measure angles) the angle is measured as 18o  than with tan(α)=a/d it follows that d=70 / tan(18) = 215,4m.
You can obviously see the difficulties. The distance to the base of the tower is actually based on the centre of the tower, below the peak.
When moving to larger objects (like mountains) it gets more difficult to measure the exact numbers, however not impossible.

So can this simple method be used to calculate the distance to the sun?

Well not immediately. First of all, we cannot measure the size of the sun. Secondly the angle you would get would be so small (the sun has a 0,5o angle) the margin of error would be huge. In the picture above, using 18.5 degrees would calculate to 209 m for d.

So how to do it then? Well, you could pick two places on earth, with a known distance, and calculate the angle to the sun at those places, at the same time.. But again, the angles would be minute.. actually the distance between the points would be less than the diameter of the sun. And off course there is the curve of the earth. For every 111 km the angle would change 1o , but the curve of the earth cannot be taken into account, at the moment.
We need to make the distances bigger, way bigger, bigger than the diameter of the earth, if possible.

The greeks were the first to attempt this. Anaxagoras (500 b.c.), Aristarchus (300 b.c.) used the angle to the moon to calculate relative distances and sizes. And found a relative distance of the sun being 20 further away than the moon (See the ancient experiment explained)

Along came Johannes Kepler some 2000 (around 1600) years later. He established his three laws of planetary motion (https://www.britannica.com/science/Keplers-laws-of-planetary-motion)

1. All planets move about the Sun in elliptical orbits, having the Sun as one of the foci.
2. A radius vector joining any planet to the Sun sweeps out equal areas in equal lengths of time.
3. The squares of the sidereal periods (of revolution) of the planets are directly proportional to the cubes of their mean distances from the Sun.

These were based by observing the planets and their circumnavigation of the sun.
But even though Kepler at first could only make the relative assumptions. He knew the time it took for mars to circumvent the sun, and as this is 687 days he calculated that mars would be 1,5 times closer to the sun than the earth. The same goes for Venus, which is 0.72 times closer than earth (off course on average).

Based on those observations and the work of Kepler Cassini (1672) used parallax to measure the distance to mars. Is is good to be noted (on this site) that Cassini believed the earth was the center of the solar system!.
First let me explain parallax.

As the earth moves around it's orbit around the sun, the distant stars will appear to be stationary. At least in respect to each others position. Some stars actually change position, like Alpha Centauri, which shifts 0,75" (which is 0.000208o) over half a year.
But if you watch an object (like a planet) which is much closer, you will see it moves, relative to the background. Based on the angles, one could calculate the distances, using basic trigonometry. Off course both observer and observed are moving and oh, but wait.. you still would need one distance, either the diameter of the earth's path around the sun, or the distance to the object.. so it is not as simple as it sounds, but still, one step closer...

In 1771 a French astronomer called Jérôme Lalande thought of using the sun and venus as the two objects to view, like this:

Venus sometimes (They occur in a pattern that generally repeats every 243 years, with pairs of transits eight years apart separated by long gaps of 121.5 years and 105.5 years [1])) traverses the sun, as seen from the earth.
Now the angle that has been traversed by venus across the sun is like

$$\alpha = \sqrt{ (x)^2 - \frac { (t) * (v) } {2}} - \sqrt{ (x)^2 - \frac { (tB) * (v) } {2}}$$

References:

These videos I made with the program solar system scope and show from several viewpoints how Venus passes in front of the sun from june 2nd 2012 until June 6th 2012, during the solar / venus eclipse

 These videos shows venus passing infront of the sun, from a position on earth (actually the Netherlands) keeping Venus in the focus of the view. The righthand video is without the earth blocking the view This video is like the first one, only without the earth blocking the view This video has the viewpoint just outside the solar system, but with the Same as the above, only with real size sun and planets and distances Here the view is slightly less angled. This show how the orbit of Venus is different from that of Earth, explaining why a solar eclipse is so very rare