There were private tutors for those with enough money to hire them, and the Bible for everyone else. Communities sometimes got together and hired a teacher for their kids, but they only were taught the equivalent of some of elementary school. A lot of people were illiterate, and not all that long ago.
Private schools and home schooling
The poor often did not get an education... indeed, there was a movement to stop public education as they thought that, if the working class was educated, they would get above themselves... This is still prevalent in the UK with the re-introduction of grammar schools... designed to suppress 75% of children.
Home schooling, on the job training and the Rich Kids went to Private Schools where their daddy bought them a degree.
Abraham Lincoln was a good example of autodidacticism.
Church. That explains why for must of human existence the average person was a poor farmer with a lifespan of 40 years.
From their parents? Or the wealthier ones had private tutor probably.