You use this to say you hope something good happens. It is a gentle way to wish for something.
に…。
It would be good if you get better soon after taking this medicine, but... (implies uncertainty)
、。
I hope the weather is nice tomorrow.
に。
I hope you arrive in Japan safely.
に。
I really hope I don't run into any weird people.
、。
I regretted it, thinking 'I wish I had known this method sooner'.