How do we (modern day people) know how to read ancient writings like cuneiform if many people back then didn't even know how to read it?

by mista_rida_
Bentresh

There's lots to say on the topic, but I wrote about the decipherment of cuneiform in When did the modern understanding of the history of Bronze Age Mesopotamia develop? and about the general methodology for deciphering writing systems in Why haven't we deciphered Indus Valley Civilization script yet?

For the decipherment of Maya hieroglyphs, you can begin with /u/RioAbajo's answer to How exactly did historians/linguists decipher Mayan writing? and How did the Mayan Language get deciphered? Specifically, why did Whorf and Knorozov think its syllabic?