"To" is used as:
* A preposition: "I went to the store."
* An infinitive marker: "I want to go."
"A" is used as:
* An indefinite article: "I have a dog."
Without context, it's impossible to know which spelling is correct. Please provide the sentence you are trying to write!