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!
Direct object pronouns are used to replace a noun that is the direct object of the verb. They are used when talking about who or what an action is done to. For example, in the sentence 'I bought the ...
Indirect object pronouns are the same as direct object pronouns, apart from lui (to him/her) and leur (to them.) ...