Test: can the word sit directly before a noun phrase and complete a where or where from meaning? She stood near the gate passes; Don't go near does not, because there is no noun phrase following for the word to point to, so no where meaning gets completed.
Most of these words sit in a single class, but near can shift between preposition, adverb, and adjective depending on its sentence, so it gets a closer look below alongside the classifications of the rest.
Place prepositions point to location before a noun phrase. At names an exact point, as in The keys are at the door. Under gives position relative to something, as in The cat hid under the table.
Source prepositions name where something starts. From is easy to spot because it answers where from? in She walked from the station.
Nearby-position words are the tricky group. Near often works like a preposition in We waited near the gate, but it can also act as an adverb, so its class depends on the sentence around it.
Non-prepositions that look similar fail the test. No is a determiner or negative answer, never before a place noun. Compare No tickets left with under the table: only the second has a word preceding a place noun phrase.
Non-prepositions that are verbs fail in another way. See takes a person or thing as its object, not a place. I see the lake is an action of watching, not a location.
The one boundary worth watching is near. Most words sit firmly in one class, but near moves. Before a place noun it behaves like a preposition: We waited near the gate. Stand it alone after a verb and it works as an adverb: Don't go near. Describing a noun, it can even read as an adjective: the near shore.
So the test needs one refinement. A word is only a preposition when it directly precedes a noun phrase and that phrase completes the location meaning. Near the gate passes; Don't go near does not, because there is no noun object to recover after the word, nothing that could complete the where meaning. A good dictionary entry shows that near can serve more than one part of speech, so check yours if you are unsure.