We use the third conditional to talk about hypothetical past (things which didn’t happen in the past).
If + past perfect, would (could,might) + have + past participle
Had + past perfect, would (could,might) + have + past participle
If I had met you last week I would have told you about it.
If you had known that you could have done something about the problem.
If he had called me straight away I would have come and helped him.
If she had come earlier she might have met us there.
If we had run faster we might have caught that train.
Had we met under the different circumstances we hight have become friends.
Had we got up earlier we wouldn’t have missed our bus.