为了 as a preposition
Structure:
为了 + [ some purpose ], Subject + Predicate
Meaning:
When 为了 indicates the purpose of an action, it’s usually acting as a preposition. In this role, the whole “为了 phrase” should come before the verb.
Examples:
为了 钱 , 他 出卖 了 朋友 。
Wèi le qián, tā chū mài le pénɡ you
(money is the purpose) He betrayed his friends for money.
为了 as a verb
Structure:
Subject + ( 是 ) + 为了 + Objective
Meaning:
Occasionally you will see 为了 acting as a verb by itself. In this case, it usually combines with 是, and the meaning is not hard to derive: “to be for.”
Examples:
我这么做 是 为了 你 。
Wǒ zhè me zuò shì wèi le nǐ
Did is for you.