Express purpose, reason, or cause. In this case, 'ために' is used to indicate the reason or cause leading to the action or event mentioned afterwards.日本に行くために、日本語を勉強しています。
Dictionary form verb + ことにするN4
Expresses the speaker's decision to perform an action. 'ことにしました' is the past form, indicating that the decision has already been made.毎日運動することにしました。
Verb dictionary form + ようにするN4
Express effort to perform an action. 'ようにします' expresses the speaker's intention or effort to perform the action.健康のために、野菜を食べるようにしています。