Form and rules
How it works
Wish/if only + past simple expresses an unreal present situation: I wish I had more time.
Wish/if only + past perfect expresses regret about the past: I wish I'd studied harder.
Wish + would can express a desired change in someone/something's repeated behavior or a situation outside the speaker's control.
Wish + could expresses a desired ability or possibility: I wish I could drive.
If only is generally stronger or more emotional than wish.