You can use either “if I were” or “if I was,” depending on the context.
If I was is used in the indicative mood in a conditional sentence to refer to actions or situations that are likely or possible (e.g., “If I was rude, I should apologize”).
If I were is used for sentences in the subjunctive mood to refer to actions or situations that are unlikely or impossible (e.g., “If I were king, I’d live in a castle”).