The others have answered... I'll just add... DON'T worry too much. There are lots of exceptions to the rules and it can be confusing.
It's even worse with English spelling! Oh! All those WEIRD spellings!
Be patient, listen to a LOT of native speakers (TV/cinema/radio) and GRADUALLY the sounds will become familiar. I'm trying to learn Hindi and Tamil, and believe me, I keep having to tell myself to be patient and not panic!!!!! I hope MY advice to MYSELF will help YOU remember to go slow, and not worry!