Answer:
The Direct Object, is the part of the sentence that receives the action of the verb. It is used to replace a person, animal or thing in the conversation or in the writing in order to avoid repetition; when they have already been seen in a sentence or external context where the statement occurs.
According to the Subject Pronouns the Direct Objects are:
1st person singular Yo: me
2nd person singular (informal) Tú: te
2nd person singular (formal) Usted: lo/la
3rd person singular El/eso/Ella/esa: lo/la
1st person plural Nosotros: nos
2nd person plural Ustedes (In latinAmerica): los/las
2nd person plural Vosotros (In Spain): os
3rd person plural Ellos/Ellas: los/las
In the sentence Ayer compré el jabon (yesterday I bought the soap), el jabon (it) receives the action of the verb compré (bought).
Then, according to the list above, the Direct object that fulfils el jabón (third person singular masculine eso) is lo.
Therefore, the correct answer is C:
Ayer lo compré