To is a preposition and a versatile little word that can be used to say many things. You can use it to indicate a goal or a direction of movement, as well as a place of arrival. That's the way you use it when you say you're going to class tomorrow.
When can I use to or for?
You need to use “to.” It might seem complicated, but the answer is actually very simple. Use “to” when the reason or purpose is a verb. Use “for” when the reason or purpose is a noun.
What is the purpose of the word to?
1 —used to indicate that the following verb is in the infinitive form I like to swim.