N3
のに
For (doing); in order to (with use, cost or evaluation words)
風が強すぎて、ピクニックシートを広げるのに苦労した。
The wind was so strong that I struggled to spread out the picnic blanket.
Explanation
Dictionary-form verb + 「のに」 shows use or purpose: 'for doing...'. 「このハサミは、紙を切るのに使う」 (These scissors are used for cutting paper). The second half is usually one of three kinds: use words like 「使う」 and 「必要だ」; cost words like 「時間がかかる」 and 「お金がかかる」; and evaluations like 「便利だ」 and 「いい」: 「辞書は外国語を勉強するのに便利だ」 (A dictionary is handy for studying a foreign language).
Mixed up with
Don't confuse it with the contrast 「のに」 ('even though'). That one follows the plain form, ends in a full sentence, and carries complaint or regret: 「勉強したのに、不合格だった」.
The purpose 「のに」 follows a dictionary-form verb and is followed by words like 「使う・かかる・便利だ・必要だ」: 「通勤するのに車を使う」.