Aristarchus around 270 BC derived the Moon's distance from the duration of a lunar eclipse (Hipparchus later found an independent method).
It was commonly accepted in those days that the Earth was a sphere (although its size was only calculated a few years later, by Eratosthenes ). Astronomers also believed that the Earth was the center of the universe, and that Sun, Moon, planets and stars all orbited around it. It was only natural, then, that Aristarchus assumed that the Moon moved in a large circle around Earth.
Let R be the radius of that circle and T the time it takes the Moon to go around once, about one month. In that time the Moon covers a distance of 2πR, where π~ 3.1415926... (pronounced "pi") is a mathematical constant, the ratio (circumference/diameter) in a circle.
An eclipse of the Moon occurs when the Moon passes through the shadow of the Earth, on the opposite side from the Sun (therefore, we must be seeing a full Moon). If r is the radius of the Earth, the shadow's width is close to 2r. Let t be the time it takes the mid-point of the Moon to cross the center of the shadow, about 3 hours (in eclipses of the longest duration, when the Moon crosses the center of the shadow).
Assume the Moon moves around Earth at some constant speed. If it needs time T to cover 2π R ~ 6.28R, and time t to cover 2r--then
6.28 R / 2 r = T/t
From this Aristarchus obtained
R/r ~ 60
which fits the average distance of the Moon accepted today, 60 Earth radii.