The undefined article exists in 2 forms (in the english language).
A is used followed by a noun that starts with a (spoken) consonant.
An is used followed by a noun that starts with a (spoken) vocal.
Usually a written vocal/noun is the same in spoken language, but there are some rare exceptions. If i find one i will tell you.