〜ために(目的)
〜ために expresses a purpose you actively pursue: the preceding verb must be volitional (dictionary form) or a noun with の. Subject of both clauses must match. Contrast with ように, which takes non-volitional verbs or potentials and expresses a state you hope will come about. Rule of thumb: controllable goal → ために, uncontrollable state → ように.
家を買うために、お金をためています。
I am saving money in order to buy a house.
日本の大学に入るために、日本語を勉強しています。
I am studying Japanese in order to enter a Japanese university.
健康のために、毎朝走っています。
I run every morning for my health.