Indicates purpose or benefit — 'for', 'for the sake of', 'in order to'. Often used as V-dictionary + ために or Noun + のために.
日本語を上達させるために毎日勉強している。
I study every day in order to improve my Japanese.
事故を防ぐためにヘルメットをかぶってください。
Please wear a helmet to prevent accidents.
彼女のためにプレゼントを買った。
I bought a present for her.
Indicates cause or reason — 'because of', 'due to', 'as a result of'. Often appears as Noun + のために.
雨のために試合が中止になった。
The game was cancelled because of the rain.
渋滞のために遅刻してしまった。
I was late because of the traffic jam.
彼は病気のために会社を休んだ。
He took time off work because he was ill.