ように

JLPT Level: N4
Meanings

In order to

So that

In such a way that

To avoid or prevent (negative outcome)

Usage

V-辞書形 + ように

い-adjective stem + ように

な-adjective/名詞 + な + ように

Nの/な/で + ように

V-ない形 + ように(〜ないように)

Explanation
ように is used to express intention or purpose, similar to "in order to" or "so that". It links a preceding action or state with a desired outcome or result. It can also convey a request or instruction when used after a verb meaning to avoid or prevent something, or after 言う/願う/祈る to express a wish that something should happen. The nuance is that the speaker has a goal in mind or a desired condition, and the following clause describes how to achieve it or what should be avoided.
毎日運動するようにしている。
まいにち うんどう する ように している。

I make sure to exercise every day.

風邪をひかないように、手をよく洗っている。
かぜをひかないように、てをよくあらっている。

I wash my hands well to avoid catching a cold.

静かになるように、窓を閉めた。
しずかになるように、まどをしめた。

I closed the window so that it would become quiet.

道に迷わないように、地図を持って出かけた。
みちにまよわないように、ちずをもってでかけた。

I took a map with me so that I wouldn’t get lost.

先生は遅刻しないようにと注意した。
せんせいはちこくしないようにとちゅういした。

The teacher warned us to not be late.