Regarding how we're able to do 2, there are a few different ways:
Sometimes the ancients tell us! We have grammatical texts that include phonetic descriptions. Granted the vocabulary used is often imprecise, or overly based on the Greek grammatical tradition, but it still gives us lots of useful information (this is the same way we know Greek used to have a pitch accent rather than a stress accent like it has today)
Similarly, the same way you get complaints or jokes about people pronouncing (or spelling) a word the "wrong" way
This leads into one of the other big ways: misspellings. For instance we have graffiti from Pompeii that replace Latin c with Greek kappa, a letter we know was always pronounced hard, even before i & e. We also do not have graffiti where Latin c is replaced with s. This suggests that the people of Pompeii did not pronounce the letter c the same as an s before e & i (like most modern Romance languages), but instead kept a hard k sound there
The structure of the alphabet also gives us some clues, although it is weaker evidence, as these sorts of quirks can stick around long after they cease to be accurate, and can even persist when the alphabet is borrowed into a new language. The fact we have words spelt with ci and words spelt with si, and which is which stays consistent for so long is suggestive of the fact they were pronounced differently (of course, this doesn't rule of ci being pronounced with a ch sound as in Italian, or a th sound like in some parts of Spain). Similarly, the fact that j & i are spelt with the same letter in Latin itself suggests that they were felt to be in some way similar sounds (the best candidate being that j was pronounced y) - likewise v & u (with v being pronounced w)
We also have evidence from poetry. In English, we're most familiar with poetic structure in terms of rhyme schemes, but in Latin it was mostly about rhythm. You have a metre which requires that syllables of certain "weight" fall in certain parts of the line. This allows us to determine things like vowel length, syllabification of consonant clusters between vowels, and that final -m was not actually a consonant, but instead marked nasalisation of the preceding vowel
We can also look at how words are borrowed between languages. We know that Ancient Greek gamma kappa chi were all stops for various reasons (chi and gamma later became fricatives) and that they were voiced, voiceless unaspirated, and voiceless aspirates respectively, and we also know that in borrowings into Greek from Latin, Latin c is consistently rendered with kappa regardless of the following vowel. This again supports c always being hard in Latin, as well as it lacking aspiration (this is often difficult for English speakers to hear, but it means it would have sounded more like a Spanish c than an English k)
These are all classic philological methods, and were well established in the 19th century. What began in the 19th century though was the comparative method of historical linguistics, as well as widespread appreciation of dialectology
The comparative method relies on looking at a variety of languages and carefully comparing their structures to deduce facts about their common ancestor, based on a few principles (one of the main ones being that sound change is, as a rule, regular i.e. that a given sound in the mother language will have the same outcome in the daughter language, when it occurs in the same environment)
This lets us do things like observe that Sardinian always inherited Latin c with a k sound, rather than ever with a soft sound. A change from a soft sound to a k sound is much less common cross-linguistically than a change from a k sound to an s sound, so on comparative grounds we should reconstruct Latin as always have a hard k sound for the letter c
Then, especially in the 20th century, we started getting extensive dialect data, drawn from many more dialects than was previously practical. This allows us to do more powerful comparison and be more sure of our reconstructions
There are still some open questions, but they're mostly over pretty minor phonetic details. Probably the only one that would affect the pronunciation in a way a layman would notice is whether Classical Latin had any difference in vowel quality between short and long vowels, or was it solely one of length (e.g. was i just like ī but shorter, or was it also pronounced more centrally in the same way the English vowels in KIT and FLEECE differ in quality as well as length)