Question: when to us a or the?
Answer: A: you use this when you're not necessarily referring to a specific thing (such as a nail, any nail). ... 
An: it's used just like a, but when preceding a vowel sound. ... 
The: you're talking about a definite item, which is why the is called a definite article.