In American English, there are several instances where you would use “an” instead of “a” to speak or write correctly. Both “an” and “a” are called indefinite articles because they don't tend to be as specific as other forms of articles like “the.” If you say, “I was talking to a dog,” it’s not quite the same as saying, “ I was talking to the dog.” “I want a sandwich” is equally not as specific as “I want the sandwich you are holding.”
Lots of people are taught the rule that it is important to use “an” instead of “a” when words begin with a vowel. This is not exactly accurate. Some words beginning with a vowel are best proceeded by “a” instead of “an”. Actually the difference lies in how the word sounds, not the letter with which it begins. If the initial sound of the word sounds like a consonant but begins with a vowel, paying attention to that sound can help you decide that words like the following take “an” instead of “a.” Here are some words where it is easy to determine that “an” is the appropriate choice: An apple, an orange, an only child, an Italian, an early start, an eel, an unusual situation.
The vowel sounds produced in the first sound of each word in the above examples are classic vowel sounds, like short A, long O, short I, short E, long E and short U. These words, when they begin with such sounds, will tend to take “an” instead of “a”. Furthermore, words with a silent “h” like “herb” and “heir” often take “an” instead of “a”. In British English, you’ll find a few more words that drop the h sound and take “an” than you will in American English.
There are words that begin with vowels that will take “a” instead of “an”. The long U sound in words like ukulele, usual, useful, actually produces a “y” sound at the beginning comparable to the opening sounds in words like youthful. Though it would seem to make sense to use “an” instead of “a” since these words begin with a vowel, it isn’t just about the letter, but the sound. You would use “a” before ukulele, useful or usual. Furthermore, a few words with an “o” like one and once, make a beginning “W” sound and take an “a.” Examples include: a once in a lifetime opportunity, a useful tool, and a ukulele.
Lastly, you might be using an indefinite article before a number or a letter. Here, be directed by the opening sound of the number or letter. An H, an 8, an O, an A, and an S are correct, as are a 1, a 7, a T, a U, and a 2. Make sure that the opening sound is pure vowel, not a hidden consonant sound, when you plan on using “an” instead of “a”.