The sound that decides which form goes in front
The article in front of a noun is chosen by the first sound you hear, never by the first letter.
It takes an hour to reach a university on the far side of the city.
The indefinite article has two written forms, and the choice between them is settled by the first sound of the next word, never by its first letter. One form is used when that word begins with a consonant sound, the other when it begins with a vowel sound. Because English spelling and English pronunciation drifted apart centuries ago, the letter and the sound frequently disagree, and it is always the sound that wins. Say the following word quietly to yourself before choosing, and the rule never fails you.
The trap catches careful learners rather than careless ones, because a careful learner looks at the written word. In the first example sentence both nouns open with a consonant letter that is silent, so the first sound is a vowel and the longer form is required. In the second sentence both nouns open with a vowel letter but are pronounced beginning with the gliding consonant made by raising the tongue towards the roof of the mouth, so the shorter form is required. The third sentence shows both traps at once: an abbreviation whose first letter is a consonant but is read aloud as its name, which starts with a vowel, and a number word beginning with a vowel letter but pronounced with a rounded-lip consonant at the front.