ように and ために can be translated as "for" or "in order to," there are some nuances to consider:

ように

Expresses intention, purpose, or goal.

Conveys a desired outcome or condition.

Often used when the speaker has some influence over the outcome.

い-adjective:

おいしい料理を作るように、新しいレシピを学びます。

I will learn new recipes to cook delicious dishes.

な-adjective:

静かな場所で勉強できるように、図書館に行きます。

I will go to the library so that I can study in a quiet place.

Noun:

旅行の計画を立てるように、地図を調べます。

I will examine the map to plan for the trip.

Verb:

体調を整えるように、毎日運動します。

I will exercise every day to maintain my health.