In Japanese, when you want to express that you wish for something, you can use the following pattern:
- Noun or Na-adjective + だといい
- Verb (in dictionary form or potential form) + といい
- 優しい人だといいね。 [Yasashii hito da to ii ne]
- I hope he/she is nice person.
- みつかるといい [Mitsukaru to ii]
- I hope you find it. (literally: I hope it is found)
- 来年、日本に行けたらいいね。 [rainen, nihon ni iketara ii ne] (potential form)
- Next year, I hope we will be able to go to Japan.
You can also use the [dattara ii] or [~tara ii] with no change in meaning.
- みつかったらいいね。[mitsukattara ii ne]
- I hope you find it.
However, if you want to express a strong desire for something to happen, you can use the following form.
- どうか + ~Verb in polite form (~ます or ~ません) + ように + Some form of 祈る
- どうか試験を合格しますようにお祈りします。[douka shiken wo goukaku shimasu you ni oinori shimasu]
- I pray that I pass the test.
祈る(inoru) here means to pray or to wish, and an extra polite form of this (お祈りします) is used here.
どうか (douka) here means “please”, though it can have other meanings including “somehow”.
Both the 祈る and どうか parts can be omitted, like this:
- I hope that I pass the test.
If you want to just wish something to “be” you should use である (dearu) rather than です (desu). These words essentially mean the same thing but “dearu” is more formal and thus more appropriate here.
- 正解でありますように 「seikai dearimasu youni]
- I hope it is the right answer.
These expressions can be used in a religious context, as if praying to God, however using them doesn’t imply you believe in any specific religion.
You can also use the potential form (ex: 合格できますように), though from what I have seen it is used less frequently than the dictionary form in this construction.
By the way, in a more general sense “(の)ように” is used to mean “as if” or “like” (ex: 風邪のように => “like the wind”). It is commonly used when you want to show a desired outcome you are targeting, in the sense of “such that ~” or “so that ~”. For example,
- I will try hard so that I can pass the test.
Notice that for this meaning, the non-polite form of the verb (合格する) is used instead of the ~masu form.
This ”〜のように祈る” pattern discussed above is really just a specific case of this, meaning “Pray such that ~”.