In most sentences, you will say, “I was.” However, if the sentence starts with “if” or talks about a wish or a hypothetical situation, you are writing in the subjunctive mood. In this case, you would say “I were”