Step 1: Look at the result clause.
The result clause "wouldn't have got typhoid" uses the form "would have + past participle". This tells us we are talking about an imaginary past situation that did not actually happen.
Step 2: Recall the rule for this kind of sentence.
When the result clause uses "would have + past participle", the "if" clause must use the past perfect tense, "had + past participle". This pairing is called the third conditional and it always talks about a past that cannot be changed now.
Step 3: Test each option against this rule.
Option A uses "would have taken care" inside the if-clause itself, but an if-clause never takes "would have", so this is wrong. Option B uses "took care", simple past, which belongs to the second conditional and does not match the past perfect result clause. Option C uses "take care", simple present, which belongs to the first conditional and clashes even more with the past result clause. Option D uses "had taken care", exactly the past perfect form the rule calls for.
Final Answer:
Only option D pairs a past perfect if-clause with the past perfect conditional result. \[ \boxed{\text{Option D: If you had taken care you wouldn't have got typhoid}} \]