As a preposition:
I gave the ball to the girl. “To the girl” is a prepositional phrase.
To whom it may concern. Again, “to” conveys action, which is what preps do.
Then there is the great (great!) John Keats poem titled “To My Brothers”. Again “to” is used as a preposition. You might ask “To whom?” And I will reply, “To my brothers.”
Infinitives:
To eat is to live. Coincidentally, this is my motto. I love eating.
To be or not to be; that is the question.
I like to eat.
Well I guess that’s it: “to” is either a preposition or it is used with the infinitive form of a verb.