One form, four jobs: purpose (ように), effort (ようにする), change (ようになる), resemblance (ような) — and 通りに beside them.
〜ように (purpose) V-dict / V-potential / V-nai + ように、〜
Verb (dictionary/potential/ない form) + ように + clause. Expresses purpose with non-volitional verbs: 'so that'.
忘れないようにメモを書いた。 I wrote a note so that I wouldn't forget.
〜ようにする V-dict / V-nai + ようにする
Verb (dictionary/ない form) + ようにする. Expresses making an effort or habit: 'try to, make sure to'. ようにしている = habitual effort.
毎日野菜を食べるようにしています。 I make sure to eat vegetables every day.
〜ようになる V-dict / V-potential / V-nai + ようになる
Verb (dictionary/potential/ない form) + ようになる. Expresses a change over time: 'come to, reach the point where, become able to'.
日本語で電話ができるようになった。 I've become able to make phone calls in Japanese.
〜ような / 〜ように (like) N の / V-plain + ような + N; + ように + V/adj
Noun + のような (before nouns) / のように (before verbs and adjectives). Makes a comparison or gives an example: 'like, as, such as'.
彼は子供のような笑顔で笑った。 He laughed with a smile like a child's.
〜通りに N + の通りに / N + 通りに / V-dict・V-ta + 通りに
Noun + の通りに / V-dict, V-ta + 通りに. Means "as / in accordance with / just like".
説明書の通りに組み立てた。 I assembled it according to the manual.