ような (before nouns)
ように (before verbs/adjectives/clauses)
The structures ような and ように are used to express similarity, comparison, or manner – meaning "like," "as," "as if," or "similar to." They are based on the noun よう (样 – appearance/manner), and the form you choose depends on what follows.
Use ような when modifying a noun. It works like a な-adjective.
When following a noun, attach の before ような: Noun + のような + Noun
When following a verb (plain form), attach ような directly: Verb[plain] + ような + Noun
Use ように when modifying a verb, adjective, or clause. It functions as an adverb.
Similarly, Noun + のように and Verb[plain] + ように are the patterns.
Simile / comparison: Comparing one thing to another.
"As if" / appearance: Describing how something appears or feels.
Giving examples: Meaning "such as" or "like" when listing.
ような and ように also introduce a representative example rather than a comparison.