Hi lily!
Thanks for your message.
「に」" for moving to/at a point of arrival
「で」" which is attached to the place of movement or action
例です。
「に」→食堂に行く
田中さんにお土産をあげる
アメリカに帰る
東京に行く・東京に行く予定だ
彼に日本語を教える
「で」→食堂で食べる・食堂で弁当を食べる
会社で働く・会社で朝から働く
教室で本を読む・教室で静かに本を読む
部屋で洗濯する
So, "study" is an action, so it becomes "de".
Ask me again anytime... ♪