I'm really interested in Biblical studies, so I've often wondered this about the languages in the Bible. Namely, Greek (Koine), Hebrew, and Aramaic.
I've tried looking into it, but I've never really been given a satisfactory answer. Usually, people will explain to me how we can determine the certain meaning of a word, using the modern form of the language, and languages of the same language family, but this does not explain how we came to figure out the grammar and syntax of a language, when many of its parts have no modern analogue. How did we figure out how μι verbs worked in Ancient Greek, for example? Or, how did we figure that א and ע were once pronounced?
How do we go about reconstructing the grammar and syntax of a dead language (mainly, I'm wondering how this was specifically done for the languages in the Bible, but an answer for how this is generally done for any dead language, or a focus on only one of them will be fine as well)?
Is there any research that I could read about the subject?