I agree with Sara Y.'s answer. You need to use "an" before a vowel and before a vowel sound even if the letter is a consonant, The vowels are a, e, i, o, and u, so for example.
an apple
an egg
an igloo
an orange
an umbrella
"An" is also used before words that begin with a vowel sound.
an hour (because the "h" is not pronounced, so it sounds like "our" which starts with a vowel.
We would use "a" with words starting with "h" if the "h" is pronounced, for example, a habit. The "h" is pronounced in the word "habit."
It's interesting that even if we are saying letters that are consonants, we have to use "an" if the sound of the letter starts with a vowel sound. For example, an m. because the sound of "m" is like em. Also, other letters, such as "f," "x," "r," and "s" also have a vowel sound as their first sound, so you would use "an."
Maybe you have played word games where you have to guess letters. You would say, "Is there a 'b,' but you would say, "is there an "s," If you watch Wheel of Fortune on TV, you'll hear the players use this rule when they call out letters.