ために: The purpose of something

In order to x, y…

Nouns: Noun + の + ために + sentence
母 の ために やさい お たべる = for my mother, I eat the vegetables.

Verbs: Verb in dict. form + ために + sentence
あそぶ ために 玉 お かいます = for the purpose of playing, I buy a ball

You can chain longer sentences using ために: にほんご お すこし はなす ために 日本 の ほん たくさん よみます。In order to speak a little bit Japanese I read a lot japanese books. (todo: check grammer on this one)

The last verb defines whether the sentences is formal or casual. So you can use the casual dictionary form in the first sentence and end with ます = formal.