"If I were you" is correct.
You may also hear some native speakers saying "If I was you", but it sounds quite uneducated.
Here "were" is the past subjunctive of the verb "to be" ("si yo fuera tú"). However, it is identical in form to the plural of the past indicative of the same verb ("we were", "you were", "they were"), and since the subjunctive is not often used in English, some people mistake it for a past indicative form and "correct" to the singular "was" (literally "si yo fui tú").
But "If I were you" is more or less a set phrase, so tends to get re-analysed in this way much less than other phrases containing the subjunctive.