〜に行く
go (somewhere) to do
Verb ます-stem + に + 行く / 来る / 帰る
Sign up free to review this point on a spaced schedule.
To say what you're going somewhere to do, put the verb's ます-stem before に and a verb of movement: 映画を見に行きます, "I'm going to see a film"; 本を借りに来ました, "I came to borrow a book".
The stem is the part before ます: 見ます → 見, 買います → 買い, 泳ぎます → 泳ぎ. With する nouns, the noun alone can go before に: 買い物に行きます, "I'm going shopping".
The destination, if there is one, comes first with に or へ: 図書館へ本を借りに行きます. Two に in one sentence is fine; they're doing different jobs.
Examples
デパートへ服を買いに行きます。
I'm going to the department store to buy clothes.
友達がうちに遊びに来ました。
A friend came over to hang out.
図書館に本を借りに行きます。
I'm going to the library to borrow books.
海へ泳ぎに行きましょう。
Let's go to the sea for a swim.
昼ご飯を食べに帰ります。
I'm going home to have lunch.