"Both" is a determiner. It is used to specify that there are two things being referred to.
Here are some examples of "both" used as a determiner:
* Both dogs are friendly.
* I ate both cookies.
* Both of my parents are teachers.
Prepositions are words that show the relationship between a noun or pronoun and another word in the sentence. They often indicate location, time, or direction. Examples of prepositions include: on, in, at, to, from, with, by, etc.
Here's the difference in action:
* Both (determiner) my friends (noun) are coming.
* I am going to (preposition) the store (noun).