The verb wish has a direct meaning (like in "we wish you a Merry Christmas") and it is also used in the conditional sentences.
We say "I wish" + a condition when we regret something. We can speak about either the present / the future, or the past.
I wish I had a million dollars. I don't have a million dollars, but it would be great if I did.
I wish I had a job. I don't have a job now, but it would be nice to have one.
I wish I could fly. I can't fly, but it would be awesome if I could.
I wish I hadn't gone to that club. I regret that I went there.
I wish I had followed your advice. I regret that I didn't follow it.
How to make sentences with "I wish..."
After the words "I wish" we put the part of the complex sentence that goes after "if" in the conditionals.
Study the example
I wouldn't have been sick if I hadn't had so much coffee in the morning.
I wish I hadn't had so much coffee in the morning.
So, if we speak about the present or the future (= the second conditional), then the sentence has the following structure:
I wish ... + past simple
If we speak about the past events (= the third conditional), then we form our sentence like this:
I wish ... + past perfect
Would and wish in the second conditional
|"if"-part in the past simple|
||It would be nice if
||I lived by the seaside.
Would and wish in the third conditional
|"if"-part in the past perfect|
||I wouldn't have gone there if
||you had stopped me.