We use 'had ...' + 'would have ...' for something that could have happened in the past, but didn't. This is called the third conditional.
If I had known that, I would have studied!
Please note (again) that we don't use 'would' in the part of the sentence that has 'if'.