に for existence and direction; で for where actions happen
Structure
Place + に + ある/いる/行く / Place + で + action verb
Examples
としょかん に ほん が あります。
Toshokan ni hon ga arimasu.
There are books in the library.
としょかん で べんきょう します。
Toshokan de benkyō shimasu.
I study at the library.
えき に いきます。えき で まちます。
Eki ni ikimasu. Eki de machimasu.
I go to the station. I wait at the station.
Notes
Ask: is something simply there (に), or is an activity happening there (で)? Movement toward a place also takes に.
Drill this pattern on your phone
The app turns every N5 pattern into spaced review, with reminders so it comes back before you forget it. Start as a guest — no account needed. Get the app →