Differentiation between COD (direct object) and COI (indirect object) can be tedious, but once you've understood the basic rules, things get a lot simpler!
Indirect object pronouns close indirect object pronoun An indirect object pronoun replaces a noun that is the indirect object in a sentence, eg ‘I give an apple to the man’ becomes ‘I give him an ...