Anonymous our teacher explained it openly but not to face same problem again look up the pronounciation of the word.
For example university.Which one will you use a or an? Though it may seem you an because the word starts with a vowel it is spelled as (I can't write one of the symbols exactly)/'ju:ni'v3
iti/ Here j means you will spell it as you spell the vowel u in English.So, this will help you which one to choose.