So, if you see, で is maybe more like the English equivalent of doing something "in" a place. に is more like when you are going somewhere.
Though there is overlap of course, 'at' is probably a better fit for 'de' than 'in.'
You will learn other uses for them later, and really it isnt worth getting too stressed about particles, but here are 3 basic ways to remember movement/location particles.
で indicates that you or someone else is doing some movement, activity, etc at a place. Before で there will be a location, and after で someone will be doing something there.
Library で reading a book. としょかんで本を読む。
Care で drinking coffee. きっさてんでコーヒーを飲む。
As you can see, the verbs here are action verbs. They are things you can do at a certain place.
に and から and へ (pronounced e but typed he) indicates movement towards or from a place. Before に and へ is a location, and afterwords there will be a movement verb like 行く, かえる、 くる etc.
library に went 図書館に行った。
America から came アメリカから来ました。
house へ return うちへかえる
Note the difference between a movement verb and an action verb. Movement verbs move between places while action verbs do things at places.
に can also be used as a location particle. In that case, it is usually followed by あります or います and in both cases the translation would be something like 'there is'
school に students 学校にせいとがいます
bath に hot water おふろにおゆがあります。
To recap:
で is followed by an action verb indicates something happened somewhere.
に, へ、から is followed by a movement verb and indicates movement towards a place
に、 when followed by an existence verb such as imasu or arimasu, indicates something exists at a place (but, unlike with で above, the sentence does not specify anything about the thing other than the fact that it is at the location. で specificies some action)
And as for your worry about translating, try not to worry about it. In real life, there is always context to be your guide. You will never be handed a piece of paper saying 学校に行きます。 and be forced to make a decision based on something so vague.