[verb (plain)] + ようだ [i-adj] + ようだ [na-adj] + な + ようだ [noun] + の + ようだ [noun] + の + ような + [noun] [noun] + の + ように + [verb]
ようだ means "it seems": you are drawing a conclusion from what you have seen, heard or felt, without being sure. Verbs and い-adjectives go in front in the plain form, any tense; a な-adjective keeps な and a noun takes の. The polite form is ようです, and in conversation みたいだ says the same thing.
The ます-stem with そうだ describes how something looks at a glance, or that it is about to happen. ようだ is a conclusion you reach from evidence.
After the plain form, そうだ means "I hear that", which is a third thing again: あめがふる雨が降るそうだ reports a forecast someone else gave.
After a noun, ようだ also compares: X is like Y. まるで, "just", often goes in front. Before a noun it becomes ような, and before a verb or adjective ように.
ように after a verb, as in わすれない忘れないように, "so as not to forget", is a separate pattern.