By analogy with words you already know. In more detail, you guess mainly by recognizing morphemes, taking into account the three main spelling systems that exist within English and taking into account common phonetic pressures that alter pronunciations. Educated guessing cannot be reduced to rules, of course, but I can give you a feel for it with a scattering of examples.
Morphemes are the smallest elements of a word that have a meaning. For example, -ing and -tion are morphemes, as in going and information. If you know a lot of morphemes, you will be good at guessing pronunciation, because morphemes are usually spelled in only one or two ways, and their pronunciation in one word usually works by analogy with their pronunciation in other words.
For example, if you've seen -tion carrying that meaning in a number of words, you intelligently guess that it's pronounced the same way in a word you've never seen before, such as, say, transubstantiation. By analogy with relation, generation, acceleration, and many similar words, even transmission, which has the other spelling of the morpheme and is preceded by a different vowel, you can reasonably guess that conflagration has the stress on the second a. And you can intelligently guess that informational has the stress on -mā-.
This doesn't give you the correct pronunciation in every single case—equation is slightly different—but this is fundamentally how English spelling and pronunciation work: by analogy with related words, where having the same morpheme is the most important kind of relation.
English actually has three main spelling systems, corresponding to its three main root languages: Anglo-Saxon, Latin, and Greek.
In an Anglo-Saxon word, a vowel needs to be followed by two consonants or a consonant at the end of a word in order to be short. For example, batted vs. bated, chipped vs. griped. You know that mob is /mǒb/, not /mōb/, because of this pattern. In Anglo-Saxon words, it's as if every vowel wants to be long, but gets cut short by a terminal consonant. In Anglo-Saxon words, ch is usually pronounced /tʃ/, the "native" pronunciation.
Not so in words from Latin. Risible is /ˈrĭz.ə.bl/, not /ˈrīz.ə.bl/, and there's really no way to guess that, except perhaps by a rather superficial analogy with divisible and visible. Words from Latin usually follow pretty regular spelling, but in many cases you can't tell whether a morpheme's vowel will be long or short from its spelling—though often you can make a good guess by analogy with other words.
The soft pronunciations of c and g before i and e began in Latin, and were only introduced into English with the Norman invasion. So, Latin-derived words are normally pronounced that way, and most of the exceptions come from Anglo-Saxon, such as get, girl, and together. Anglo-Saxon words like bagged and bagging use the doubled g to indicate that the preceding vowel is short, so the g stays hard. Exaggerate and suggest come from Latin, so you know not to expect their soft g to make a good precedent for Anglo-Saxon words.
Words from Greek have a distinct spelling system, where English letters correspond to Greek letters: ch stands for the Greek letter χ; ph stands for the Greek letter φ; k stands for the Greek letter κ; th stands for θ; etc. The Greek sounds of these letters are approximated by English phonemes, as in chrysanthemum, metaphor, photon, system, synchronize, autarky, etc. Notice that ch in Greek-derived words is pronounced /k/. Greek consonant clusters that don't occur in English get reduced, as in psychology, bdellium, and pneumonia (but not sphere: we allowed /sf-/ to start a syllable in order to absorb that word). Eu- in Greek words is a morpheme meaning "good", and is pronounced /ju-/, as in eulogy and euphemism. Leonhard Euler is German, so you learn not to make an analogy between his name and Greek words.
The main difficulties with Greek-derived words involve the letters g and y, especially when they occur together. In Greek-derived words, g stands for the Greek letter γ, which we would normally represent in speech with a hard g as in gynecology and gigabyte, but phonetic pressures and misunderstandings have usually set precedents that make it soft, as in gymnasium and gyroscope. It goes silent when it's part of a reduced, un-English consonant cluster, as in gneiss. In the middle of Greek-derived words, y stands for υ, but at the end, it stands for -εια, which means the same as Anglo-Saxon -ness. The Greek vowel υ doesn't correspond well to any English vowel. Usually it's pronounced as a short /ĭ/, but English phonetic pressures sometimes shape it into a long /ī/, as in hypothesis, psychology, and papyrus. The -gy ending is a morpheme, pronounced /-dʒē/ (unstressed), found in energy, synergy, biology and even analogy, the main concept that explains how English works!
Can you really guess the origin of an unknown word?
You might wonder, "How am I supposed to guess which language a word came from?" It's surprisingly easy. Anglo-Saxon, Latin, and Greek words tend to have a very different "feel" to them, and the spellings of the words tend to follow patterns that are fairly easy to recognize. Noticing the different styles of words from each main root language is an important part of mastering English, including its huge vocabulary of synonyms. There are, of course, a few words that picked up spellings by "false etymology", such as ache and ptarmigan, but happily, it doesn't matter, because if you guess these words' pronunciations by the usual analogies, you'll be right. These spellings were established by people trying to follow the same analogies.
By the way, roughly 20–30 years ago, many schools stopped teaching children about classical roots and how they're spelled. Consequently, a lot of natives today don't know much about it consciously. So, with this clue, you can learn to do better than a lot of natives! Some kids are still being taught, though, as evidenced by the questions asked in this contest of guessing the spelling of a word (which is harder than guessing the pronunciation from the spelling). Here's an excellent article by an expert on dyslexia, about the true complexity of English spelling and what's involved in learning it.
Precedents can conflict. For example, you can make a good educated guess about impious by noticing its three morphemes: im-, meaning negation; pi-, meaning reverence or dutifulness, by analogy with pious and piety; and -ous, making an adjective in a Latin style. So, a pretty good guess is to pronounce it /ǐm.ˈpī.əs/. However, impious can also be understood as following the precedent of the Latin word impius. The phonetic pressures in Latin put the stress on the first syllable, and we usually feel the same pressures in English words that come from Latin. In fact, the English word impious, pronounced /ˈǐm.pē.əs/, was borrowed directly from Latin in the 16th century. That pronunciation has been echoed ever since. The -ous spelling in impious is a slightly stretched analogy with Latin borrowings that follow a different pattern. Consequently, both pronunciations are in use today, /ˈǐm.pē.əs/ being more standard. (I prefer /ǐm.ˈpī.əs/, since it communicates the morphemes more clearly. Someone who's never heard it before will easily understand the meaning. /ˈǐmp.ē.əs/ misleadingly echoes imp.)
I knew a native speaker who mispronounced fruition as /ˈfru.ʃən/. He was going by analogy with fruit. But /ˈfru.ʃən/ is a somewhat uneducated guess. The correct pronunciation, /fru.ˈǐʃ.ən/, better reflects both the etymology and the pressure from -tion to put stress on the preceding vowel. The spelling of fruit reflects the fact that it can break up when used as a morpheme in a larger word. And we see the same pattern established in circuit/circuitous and other -uit- words.
There is another factor at work here, too, which helps a lot for guessing pronunciations. Experience teaches you that common pressures will likely have removed the second syllable from /ˈfru.ĭt/, but these pressures don't occur in fruition. In English, there's a pressure to merge those last two syllables at the end of a word, as in biscuit, pursuit and circuit. Explaining phonetic pressures is a complex subject, but it's like everything else in English: it works by analogies and precedents, and you get a feel for it from experience. What's relevant here is that the unstressed short vowel has a hard time holding its own against the preceding long, stressed vowel without help from another consonant; the terminal -t offers only very weak support.
The word intuit is the only word of this pattern that has kept that unstressed syllable. I think people continue to pronounce it because the words intuitive and intuition are much more common, so when people use the unusual verb intuit, they feel some pressure to echo the corresponding syllable in the familiar words in order to be understood. I have heard people attempt /ǐn.ˈtut/, independently inventing the word during conversation, and then draw back from it because it sounds weird and doesn't clearly indicate the connection with intuition. There is also pressure to avoid echoing the slightly silly verb "toot".
Since pronunciation is shaped by interaction between many pressures, if you pay attention to those pressures, you are in a good position to guess the pronunciations of unknown words.
Analogies, not rules
Some people harp on the fact that English spelling doesn't follow rules, as if this were proof that English is "illogical" or completely without order. Really, though, the English language works like English common law: by precedents, not rules. When deciding new cases, or when inventing new words, people try to be consistent with previous cases or with the spellings of words already in the language. Old cases and familiar words can't pre-decide every aspect of a new case, of course. Law and language accumulate over the centuries, one case and one word at a time, embodying subtlety and hopefully wisdom beyond what could be captured by any fully articulated system of rules.
As you get to know the language better, you can often guess pronunciation from spelling pretty accurately, especially with "big" words. When I was in the 2nd grade (age 7), I was given a test where I had to guess the pronunciations of a long list of words, up to "college level". I got nearly all of them right, despite not knowing, at that age, anything about etymological spelling—and despite not having encountered most of the words before. I could usually see some sort of analogy with a word I already knew, and I made an educated guess. That's how it works.
The moral of all this is that you should not memorize rules. You should not even memorize the few rules that happen to be true. Memorizing rules runs against the spirit of the language. What you should do is make analogies from specific words to specific words that you already know how to pronounce. Occasionally you'll guess wrong—and that will teach you a new precedent, which you will apply in new situations. Eventually, gradually, you learn to perceive English spellings with acuity. (You can probably guess that it's /ə.ˈcju.ĭ.tē/, despite the spelling's ambiguity, because of its congruity with annuity and gratuity.)