为 (wèi, 4th tone) is the preposition 'for / because of'. The same character read
为 (wéi, 2nd tone) is the verb 'to be / act as / become'. Reliable trigger: if
为 introduces a beneficiary, cause, or purpose (
为了,
因为,
为什么,
为 人民), use 4th-tone wèi. If it links a subject to a role or outcome (
成为,
认为), use 2nd-tone wéi.