The main requirement is that you need a theory of what the text says. For example, if you find written texts in the palace of King Blagomar (who we know of from Ancient Greek reports) and there is a particular recurring sequence of marks, we can surmise that ᛒᛚᚨᚷᛟᛗᚨᚱ ᚨᛒᚱᚨᚢᛁᛏ has something to do with said king. If there are enough texts, we can eventually make reasonable guesses about what the sequences are about, and we rely on other languages to fill in phonetic details. It helps massively if somebody writes a trilingual text, for instance if we can establish that in a known language this snippet is written as ⸌⸝ᛍˎ⠃⸝◟ ⸝ި◟⸝╮ᛁ⸍ which we reasonably think is pronounced "blagomar abravit".
Similar methods are used to determine ancient pronunciations of known languages, such as Latin, Greek and Hebrew. If you are uncertain about the pronunciation of "p" is some context in Biblical Hebrew, one can refer to how a word (especially a name) is written in another language like Greek: is it written with π or is it written with φ? Or, when a word is borrowed from one language into another, is it ultimately realized with [p], or with [f]?