I know this is pretty basic, and this grammar point mostly makes sense: で is used to denote the method by which an action is done, whereas に is used to denote the ending location of an action, for example in a sentence such as 「電車で家に帰る。」but I’m confused by some of the examples.
EX: ホテルで寝る。vs 車に乗る。
These both seem like similar phrases to me, and have similar translations, but use different particles. I’ve thought of に as requiring a direction or an implication of movement, such as 「ここに本を置く。」 directing the location of where to place something that wasn’t there before. However, phrases like 「彼はあそこにいます。」 have no inherent movement or direction and simply state a location that someone is existing, while 「そこで寝る。」 is also just stating the location of someone doing something.
Any insight?