In English grammar, “a” and “an” are called indefinite articles. An indefinite article refers to a noun which is not specific. A noun is a word naming a place, thing, person or idea.
The sound of the first letter of the first word following “a” or “an” determines which to use. If the letter sounds like a consonant, use “a”. Be reminded that a vowel may sometimes sound like a consonant: u sounds like yoo. Likewise, a consonant may sometimes sound like a vowel: h sounds like aitch. Some examples are a dog, a hat or a yak. If someone said,” I saw a dog,” they could mean any dog (dog is the unspecified noun).
If the letter sounds like a vowel, use “an”. Some examples are an alligator, an ear or an hour (where the h is silent). In some instances where “h” has the sound of a consonant, “an” may be used. One example is with the word historical. It is usually more customary though to use “a”. For instance: The art exhibit was a historical triumph. These rules apply to acronyms too. An acronym is an abbreviation that sounds like a word, like NASA.
When an adjective comes before a noun, the sound of the first letter of the adjective is used: a rare sighting or an unjust action.
Examples of nouns that aren’t used with indefinite articles are sports such as basketball and football and the academic subjects chemistry and mathematics. Included in this are nationalities and languages like Spanish and Chinese. Lastly, indefinite articles show membership: Jim is an Englishman. I am a judge.