よう is 様 meaning of which is appearance/looks.
- adjective+よう = 広いよう
- noun+よう = 山のよう
- verb+よう = 叫ぶよう
よう itself also has variation derived from conjugation.
- adjective form ような = ような国
- adverb form ように = ように働く
- ending form ようだ = ようだ/ようです
Basically, よう describes situation in such appearance as expressed before hand or, let's say, a kind of picture imagined.
- 広いよう seems/looks like wide
- 山のよう seems/looks like mountain (exemplification)
- 叫ぶよう seems/looks like to shout
- この家はちょっと狭いようだ。
- スーパーマンのようになれたらいいな。
- 彼がそんなことをするようには思えない。
From this original meaning, several additional meanings were developed.
- way, method
- reason, circumstances, grounds
- purpose, aim, target
- guess, supposition
- softer imperative, request, solicitation
- wish, hope
When sentence ends with ように, it is a deviation because grammatically correct way is ようだ format. It means that ending with ように has following part which is unsaid.
However, there is one exceptional case of 6. wish, hope, which is called as prayer sentence format.
Usually ように is attached to ます-sentences like below.
- 病気が早く治りますように。
- 試験に合格しますように。
- 素敵な恋が得られますように。
Most of cases that ends by ように are 5. softer imperative or request.
- ように+しなさい/してください/してみなさい/してごらん(なさい)
- ご家族とよく相談して書いてくるように。is this case.
For remaining cases, omission on ending part is rarely done.
- 左手で支えるようにして右手を動かすのがポイントです。
- 尖った角にはクッションを貼って、子供が怪我しないようにしました。
- 毎朝野菜ジュースを飲んで、風邪をひかないようにすることが大事です。
- あの人はすぐに風邪をひくようです。
I made this lengthy explanation for comprehensive understanding about ように.