Many people think the rule for using a versus an is that one use “a” before a consonant and “an” before a vowel. However, this is not the real rule. The real rule is use “a” before a consonant sound and “an” before a vowel sound. Thus, the rule is not about orthography but about phonetics. Example: “a unique event” not “an unique event;” “an hour later” not “a hour later.”
Note there are some “h” words that can be preceded by either “a” or “an.” This is because in the 18th and 19th centuries the initial “h” in these words was not pronounced. Example: either “a historic event” or “an historic event,” though “a” is more logically correct today.