ため is a grammatical noun with two core meanings: purpose ("for / in order to") and cause ("because of"). The kanji 為 exists but hiragana is standard.
Common patterns
1. Purpose: Noun + のために / Verb dictionary form + ために
2. Cause: Noun + のために / Verb plain past + ために
- 健康のために: for one's health
- 家族のために: for one's family
- ~のためになる: to be beneficial for ~
- ~ためにならない: to not be good for ~
DISTINGUISHING PURPOSE VS. CAUSE:
Context usually makes the meaning clear. With past-tense verbs, ために almost always indicates cause: 遅れたために (because [someone] was late). With dictionary-form verbs, it indicates purpose: 勉強するために (in order to study).
CAUSE ため VS. から/ので:
Cause ため states an objective circumstance and does not lead into a request, invitation, or command. Say 雨なので中止にしましょう, not 雨のために中止にしましょう.
Register
ために is slightly formal, and cause ため is common in notices and written announcements. In casual speech, から or ので are more common for expressing cause.