In the third conditional we use the past perfect in the if-clause and would in the main clause.
Don’t use didn’t in the if-clause.
If we didn’t take a taxi, we wouldn’t have missed the plane.- If we had taken a taxi, we wouldn’t have missed the plane.
What would have happened if the Titanic didn’t sink?- What would have happened if the Titanic hadn’t sunk?