English conditional is one of the most common sources of mistakes for non-native speakers. The most common pattern for conditional sentences is “if someone did something, someone would do something”, e.g. “if he worked, he would have enough money” which implies that he doesn’t work, so he doesn’t have enough money.
The form used after “if” in the example above is the so called subjunctive mood. The important point to remember is that it’s the same for every verb as the simple past tense of that verb (e.g. “if I went”, “if you did”, “if he saw”), with the exception of “to be”, for which it is always “were” (e.g. “if I were”, “if you were”, “if he were”).
The subjunctive mood expresses something that (theoretically) could be happening right now, but which (in reality) isn’t happening. And this is exactly what you want to express when you express a wish, for example:
Since it is the subjunctive, not the past tense, the preferred form for I/he/she/it is also “were”, not was. Note, however, that it is quite common to use “was” in informal speech by native speakers:
Nevertheless, expressions of the form “I wish he would do something” are also grammatically correct but mean something else! “Would” is the past tense and past subjunctive of the verb “will”. This verb is most commonly used as an auxiliary verb to build the future tense, and “I wish he would do” can refer to a wish about the future. Quite commonly, however, it carries another meaning.
“Will” also means “be willing to”, “be so good/kind as to”. You may not have realized it, but you might have used this meaning already in a couple of phrases. For example, when you say “Will you excuse me?”, you aren’t asking whether the other person is going to excuse you in the future; you are asking whether they are willing to excuse you now (that is, whether they are so kind as to excuse you now).
In this sense, you can say “I wish someone would do something”, which means “I wish someone were willing to do something”. For example,
expresses that you wish the other person were so kind as not to smoke. You find the fact that they smoke unkind or irritating, whereas when you say
you merely express that your conversational partner does smoke and that you wish otherwise, without the emotional subtext.