the stress pattern of the word is essential, then remember that consonnants play a great part in the way vowels are prononced.
- if a vowel is followed by two consonnants, the vowel will be short.
- if -ed follows a strong consonnant, then it can only be prononced "t".
it's a very interesting question, and it would require a very long answer. Whole books deal with that subject. But you will also learn to pronounce new words simply by practising, through analogy with other words, etc.
Also, read new words out loud, you'll find that often, there's only one way to actually get them out lol
And when you're stuck, dictionaries and websites are your best friends.