Position of the Object Pronoun
Direct object pronouns and indirect object pronouns can appear simultaneously in a sentence. The pronouns always precede the verb. The indirect object precedes the direct object:
¿Te has comido toda la comida que ha quedado? – Sí, me la comí esta tarde, porque tuve mucha hambre.
If both pronouns are in the 3rd person singular or plural, the indirect object becomes se.
Singular:
Le/les + lo – se lo
Le/les + la – se la
Plural
Le/les + los – se los
Le/les + las – se las
Le regalo las flores a mi padre – Se las regalo
Compro a mis padres unos regalos – Se los compro.
In an infinitive, a positive imperative or a gerund, the pronouns are placed behind it, first the indirect, then the direct object pronoun:
(La pastilla) tomársela. Tómatela
In groups of two verbs (verb + infinitive or gerund) the object pronouns are either immediately before the first verb or after the infinitive or gerund:
No quiero verlo. Oder No lo quiero ver
Estoy mirandola. Oder: La estoy mirando
Resumption of the object by a pronoun
If you want to accentuate the direct object, place it at the beginning of the sentence and double it with an object pronoun.
El dinero lo cambiamos en el banco.
The indirect object is usually resumed immediately before the verb by an indirect object pronoun:
¿Le has preguntado a Diego lo que ha pasado?
The object pronoun with the preposition a is also used to highlight the object. This can also be used to make an opinion stronger:
A Neomi todo le parece muy complicado, aunque no lo es.