used to express a wish that something was different or that something had happened differently
If only I had studied harder, I would have passed the exam.
もっと勉強していれば、試験に合格していたのに。