Conditional clauses with I wish and if only describe an imaginary or impossible situation in the past or the present. We use I wish and if only to talk about things that we would like to be (or to have been) different.
Note that if only is usually stronger than I wish.
If we talk about the present moment, we can use I wish/if only + a past form of the verb.
I wish I had his phone number - I would call him immediately.
I can visit my mom only once a year. I wish she didn’t live so far away.
I wish I were tall and slim, I would work as a model.
If only my father was here right now, he would know how to cope with this situation.
If only I could help him out with his problem!
If we are talking about a past moment, we can use I wish/if only + the past perfect form of the verb.
I wish I had bought those shoes on sale, they would have looked perfect with this suit.
I wish I had never met him, I would be happy traveling around the world all by myself.
If only I had prepared for the exams better, I would have got an “A”.
We use wish/if only together with would to express annoyance with something that is or isn’t happening.
I wish you wouldn’t come home late and wake everybody up.
If only these people would stop yelling and try to listen to me.