Well, I imagine you start out just putting a stick in the ground or something each day lined up with the sunrise. Then after 365 days you notice that the sun is rising in the same place you put the first stick. After that the rest is easy.
You can discover all sorts of things that way. Noon, solstice and equinox, calender cycles (eg leap years), radius of the the earth, calendars. Combine it with water clocks, lunar observations, and tide measurements and you can discover all sorts of things to theorize about. Add straight edges and a compass and develop nomograms and slide rules and higher math. All with Stone Age technology.
It’s even an opportunity to develop the scientific method, but that’s a leap.
If the stick was lined up with the sunrise, it would be laying on the ground. However, an ancient civilization might have noted that the the tip of the shadow from a vertical stick stuck in the ground followed a straight line throughout a sunny day on either equinox, while following curved lines during a sunny day at other times of the year.
But if the ancient civilization could do that accurately enough with a stick in the ground, why did they spend the time and effort to build all the Towers of Chankillo to do the same thing?