Go somewhere to do something
The verb stem + に before いきます: たべに いきます, go to eat. The place comes first with へ or に.
JLPTN5
verb stem + に いきます (go to …)~ ni ikimasu
Take the ます-form, remove ます, add に and then a motion verb: たべます → たべに いきます, go to eat; みます → みに いきます, go to see; かいます → かいに きました, came to buy. The same form works with きます and かえります.
The place comes first, with へ or に: レストランへ たべに いきます. What you will eat or see comes first of all with を: すしを たべに いきます. With する-verbs the noun alone is enough: かいものに いきます, go shopping; べんきょうに いきます.