"If I were" can only be used if the situation is contrary to fact, or at least, pretty unlikely (it's a so-called past subjunctive). "If I was" is used otherwise. Thus you might say "If I were rich, I'd buy a Ferrari", but "If I was too loud last night, then I'm sorry". It's becoming increasingly common to use "was" even in the first case, as the past subjunctive is pretty well indistinguishable from the indicative, except for 1st and 3rd person singular of a single verb, viz. "be", so the distinction is pretty useless.