The correct answer is D. was looking.
The sentence is in the past tense, so the verb must be in the past tense as well. The other options are in the present tense, future tense, or perfect tense, which are all incorrect for this sentence.
The sentence also tells us that Jim was in the middle of looking for his contact lens, so the verb must be in the progressive tense. The progressive tense is used to describe actions that are happening in the present or were happening in the past.
The only option that is in the past tense and progressive tense is D. was looking. Therefore, the correct answer is D.