Eratosthenes did this by determining the angle to the sun from two different places. Then, he measured the distance between the two places. Using these measurements, and his advanced knowledge of geometry and mathematics, he estimated that the distance around the globe was between 28,000 and 29,000 miles (45,000 to 47,000 km).
That was awfully close to the correct value of about 24,860 miles (40,008) km.
Islamic scholars discovered the manuscript in which Eratosthenes had described
his experiment and they preserved it.