N3
ため(に)
For, For the sake of, In order to
新しい家を建てるために、土地を買った。
In order to build a new house, I bought land.
Explanation
「ため(に)」 has 2 uses
1Purpose
Verb (dictionary form) / Noun + の + ために: you do the second part on purpose to reach a goal; both parts have the same subject: 「留学するために、日本語を勉強している」.
家を買うためにローンを組んだ。
I took a loan in order to buy a house.
新しい家を建てるために、土地を買った。
In order to build a new house, I bought land.
2For someone's sake
Noun + の + ために: for the good of a person or thing: 「家族のために働いている」 (I work for my family).
私のためにやって。
Please do this for me.
君のために買ってあげたのに、誰かにあげちゃったの?
I bought this for you, but you gave it to someone?
Mixed up with
Before 「ために」 comes a verb of will (「買うために」), and both parts need the same subject.
Before 「ように」 come non-volitional verbs, potential forms or negatives: 「合格できるように」, 「風邪を引かないように」. The subjects may differ: 「子供が読めるように、平仮名で書いた」 (I wrote it in hiragana so the child could read it).