"A" is used for nouns that begin with a consonant sound.
e.g. a pen; a dog; a bus; a man; a lion
"An" is used for nouns that begin with a vowel sound /a/, /e/, /i/, /o/,/u/. e.g. an apple; an orange; an umbrella
N.B. We also use 'an' before words that begin with a silent h.
e.g. an hour; an honest man
"A", "An" are used :
e.g. I have a pencil and a rubber in my school bag.
e.g. An elephant and a mouse are friends.
Would you like a hamburger?
e.g. I'm a teacher.
e.g. a hundred people
a million dollars
N.B. We don't use 'a' or 'an' before a plural noun or an uncountable noun.
e.g. We like dogs.
I drink water.