At first, people were educated by their parents in things like how to do things around the house and a trade. Other community members also helped teach children how to do stuff too. Parents and the community also taught their culture’s values, stories, traditions etc…
Actual schools sprung up too like scribe schools in Mesopotamia or Egypt and schools in ancient Greece and Rome. Those schools were for wealthy boys to learn things like grammar, math, and logic/rhetoric among other subjects. Mostly, only the wealthy could attend school. Teachers were strict back then, and if you misbehaved or answered wrong, you would probably get beaten!
Medieval and Renaissance schools were also for the more wealthy. Universities started to develop in the Middle Ages and members were part of the clergy. The clergy was well-educated and taught it’s people to read and write as well as Latin.
Public state-run schools were a relatively recent concept. We got the model for our schools from the Prussians. They had state-run schools that taught things like being loyal to the government among the regular subjects. The whole premise of it was to educate the masses. By only as recently as 1918, every state required schooling up to at least elementary school. The reason students get summer off was to help with the farming in summer, but luckily, that tradition stuck around!