It's the Sound, Not the Letter
If you're feeling a little shell-shocked about all the grammar rules you thought you knew but don't really, things are looking up: You probably know half of what you should about when to use "a" versus "an."
Most of us learned (or at least have the vague memory) that we use the article "a" before a consonant and "an" before a vowel. If you're a native English speaker, this probably comes naturally to you, so naturally that you are wondering why it's even on this list.
Again, we harken back to exceptions. Sure, when you walk into a restaurant you're going to have to wait "an" hour for a table, but you're going to hear that from "a" hostess. What in the world?
It's not the vowel itself that makes the difference; it's the vowel sound. If the word starts with a vowel sound, add an "n" to that "a." If it's a consonant sound, it's an easy "a."