Combine the following sentence by using an infinitive:
John came early to school. He attended the extra class.
The structure of the infinitive is to+ the verb in its basic form, here, "to attend". Hence, Option D is correct. The rest of the options do not adhere to the rule, hence incorrect.