1.- Situation in the present:
I WISH / IF ONLY + PAST SIMPLE
I wish / If only I had a new car = Ojalá tuviera un coche nuevo
If only / I wish you were here = Ojalá estuvieras aquí
2.- Situation in the past:
I WISH / IF ONLY + PAST PERFECT
I wish / If only you had studied more = Ojalá hubieras estudiado más
If only / I wish he had been calm = Ojalá hubiera estado tranquilo
3.- Annoyance, dissatisfaction, impatience:
I WISH / IF ONLY + WOULD + V(infinitive)
I wish / If only you would stop speaking = Ojalá dejarais de hablar
If only / I wish you would mature = Ojalá maduraras