First, how did he guess the angle (those days they probably didn't do it in degrees, but by the effect of that angle like what is the 'tangent', that is easily measured).
At Syene, he looked into a well in which the noon-Sun didn't cast a shadow on the walls. A well is normally constructed, aligning with a plumb-bob so as to have vertical walls. If Sun is at the 'zenith' a ground object placed vertically, doesn't cast a shadow of noon-time Sun. It implies Sun is on the same angle as the latitude of that place (but Eratosthenes must have used a different language). He concluded that Syene is located on the Tropic of Cancer (as we know it, or perhaps he too knew it that way). Alexandria, supposed to be on the same longitude (it is easy to check with a compass, but he might not have had one then) but beyond the tropics & tropics is the land beteen the 'tropics of Cancer' & 'Capricorn' where at every place Sun appears vertical (at zenith) on noons of two days in Sun's transit (one south to north & one north to south).
Anyway on the summer solstice day, he must have observed the shadow in a well in Syene. By the ratio of the shadow's length on ground, to the height (from the base where the shadow is, to the 'top' that causes the apex of the shadow) that we call 'Tangent', For a 7°, it should be 0.1227645. This as a fraction of the semicircular arc (180°) that we call (here)
f = (7/180).
If this fraction is used to divide the arc distance (on the Great Circle, every great circle is Equator-like) from Syene to Alexandria, or its reciprocal (1/f = 180/7) is multiplied with the distance, that gives Earth's half Circumference. They knew the value of Pi ('π') then, that is the ratio of Circumference to the diameter (alternately, ratio of semicircular arc to the radius), But of course they were interested in the total circumference of Earth. Even Columbus and his friends based their voyage on this figure.
At 7°, one can say the tangent almost equals the angle. Actually it shoud be, with small angle approximation, is "distance/[2 Tan(7/2)]"
2 Tan(7/2)≈ 2[(7/2)] = 7° (= 0.122173 Radian; see how remarkably close to the "Tan7°" above).
Well, I used the degree measure in 7°, just for demonstration but that should never enter Mathematical calculations, which should be in Radians. Radian measure (though cumbersome to handle for someone not well-versed in calculations) directly gives the true ratio, needing no other conversion (degrees need that). In Radian measure the circumference is π times Diameter. Instead we say the angle is π Radians. If Syene to Alexandria distance is also factored as a ratio in 'Radian measure'; we get circumference by scaling it up 2π times,
distance X [2π/Radian measure] = circumference.
Now we know from the calculator the value of 'π'. But they used to do it then, with 'fractions'; the best fit for 'π' is not 22/7 but
π = 335/113.
Easy to remember too: write pairs of first odd numbers in a sequence,113355. Cut it into two, the left part (lower integers) is put as denominator or divisor and the other (right) part goes to the top as numerator, that gets divided by the denominator.
And he even has factored the error (percentage) and to know how far he can be off the mark. I think as a civilised race, by now, educated humans should figure it out without going into esoteric details like, 'degrees', 'tangents' & all that, that take us further away from what we see on ground. Things like these tell the laymen apart from Scientists; but everyone needn't be a Scientist and talk in their language. It simply cuts off people from indulging in Science. They yearn to unravel the mystery but a gulf separates them from reaching 'undersatnding'.