I was always unsure how to use this when I was in the States but it gets even more complicated in England.

The rule in the states is you use a before words that start with a consonant sound and an before words that start with a vowel sound.

So the problem in England is how things are pronounced such as the word herb. In the States we say erb and so an herb is appropriate but in England you would say a herb.

Here is a grammar girl episode that cleared everything up for me.

All the Best!

American to Britain