You can remember the meaning of 为了 with this easy mnemonic:
You were surprised to see your friend drinking protein shakes every day in order to (为) complete (了) a bodybuilding course.
Using mnemonics to remember the meaning of Chinese characters like can have an enormous impact on how long to learn Mandarin it takes.