1. He got in the car.

(What is the part of speech of 'in'?)

2. Get in!
(What is the part of speech of 'in' here?)

1. "in" is a preposition.

2. "in" is an adverb.

Prepositions always begin prepositional phrases which end with a noun or pronoun.

1. "in" is a preposition here

2. "get in" is considered a phrasal verb:
http://www.eslcafe.com/pv/pv-g.html
(scroll down a bit)

1. To determine the part of speech of 'in' in the sentence "He got in the car," we need to analyze its function. In this case, 'in' is functioning as a preposition. Prepositions are words that typically show a relationship between a noun (or pronoun) and another word in the sentence. In this sentence, 'in' shows the location or position of where he got, indicating that he entered the car.

2. In the sentence "Get in!", 'in' is functioning as an adverb. Adverbs are words that modify verbs, adjectives, or other adverbs, providing additional information about how, when, or where an action takes place. In this case, 'in' modifies the verb 'get,' specifying the direction or action of getting into something. It tells the person being addressed to enter or board a vehicle or a particular location.