Let me share what I learned at school.
If I had known, I'd have helped (= but I did not know, so I did not help)
It is third conditional to talk about an event or situation that did not happen in the past.
If + Past Perfect, modal + Perfect
If I knew, I would help. (= I don't know, so I don't help) (not If knew, I would have helped)
If I were you (= I am not you)
This is second conditional referring to a situation in the present.
If + Past Tense, modal + V1