Unreal wishes (ojalá)

While ojalá with the present subjunctive expresses realistic hopes, pairing it with the imperfect subjunctive translates to "I wish" or "if only." It signals that a desire is impossible, imaginary, or highly unlikely to come true in the present or future.

If only I won the lottery to have infinite money.
Ojalá ganara la lotería para tener dinero infinito.
If only I could undo the mistake and erase the stain.
Ojalá pudiera deshacer el error y borrar la mancha.

You can use ojalá on its own or as ojalá que—both are correct and mean the exact same thing. It is the perfect structure for daydreaming about hypothetical situations:

If only I had the gift of always being brave.
Ojalá tuviera el don de ser siempre valiente.
If only the gift of beauty were infinite!
¡Ojalá el don de la belleza fuera infinito!

It is also used to wish a current situation were different or to express frustration:

If only you had a good memory to remember that moment.
Ojalá tuvieras buena memoria para recordar ese momento.
If only you were braver to undo this disaster!
¡Ojalá fueras más valiente para deshacer este desastre!