A and an are two different forms of the same word: the indefinite article a that is used before noun phrases. Use a when the noun or adjective that comes next begins with a consonant sound. Use an when the noun or adjective that comes next begins with a vowel sound. Remember that what matters is the pronunciation, not the spelling.
Here are some examples of the article a followed by words that begin with consonant sounds. In two cases the word after a starts with vowel letter, but the pronunciation still begins with a consonant sound.
Here are some examples of the article an followed by words that begin with vowel sounds. Notice that in two cases, the word after an starts with a consonant letter, but the pronunciation still begins with a vowel sound.