Were, as a remnant of the past subjunctive in English, is used in formal contexts in clauses expressing hypotheses (if he were to die, she would inherit everything), suppositions contrary to fact (if I were you, I would be careful), and desire (I wish he were there now). In informal speech, however, was is often used instead