Used to express similarity or manner, often following a noun, adjective, or verb phrase. Common in comparisons and descriptions.
He swims like a fish.
so that; in order to
Expresses purpose or result, often with verbs of effort, change, or intention. Follows a verb or adjective in the plain form.
be sure to; make sure that
Used at the end of a sentence to give a strong request or instruction, often with a sense of warning or reminder. Common in formal or written contexts.
Be sure to be punctual.
I hope that; may
Expresses a wish or prayer, typically at the end of a sentence after the -masu stem of a verb. Often used in formal or heartfelt expressions.
I hope you succeed.
Please do it as I said.
I took notes so that I wouldn't forget.
I hurried in order to arrive early.
Make sure you don't leave anything behind.
May peace come.
ために also expresses purpose, but ように is used when the desired outcome is less directly controllable, such as with potential or involuntary verbs.
みたい is a casual, colloquial way to express similarity, while ように is more neutral and usable in both speech and writing.
とおり expresses following an exact model or instructions, whereas ように expresses general similarity or manner without implying exact conformity.
Derived from the noun 様 (よう, 'appearance, manner') combined with the adverbial particle に. The expression grammaticalized into a fixed pattern for similarity, purpose, and wishes.