If you have not learned how to use direct and indirect object pronouns click here and here first. The next step in using direct and indirect object pronouns is using them together in a sentence. You already know that and direct object is something directly acted upon by a verb and that an indirect object is the recipient of that action.
When placing the pronouns it is important to remember that they both go in front of the verb with the indirect object pronoun going before the direct object pronoun.
When there are two third person pronouns (lo, la, los, las, le, les), it is important to remember that the indirect object pronoun (le or les) will change to se.
Ella mandó una carta a nosotros. (She sent a letter to us). → Ella nos la mandó. (She sent us it.)
Yo di un regalo a la chica. (I gave a gift to the girl). → Yo le se lo di. (I gave her it.)
La mamá compró una chaqueta a sus hijos. (The mom bought a jacket for her kids.) → La mamá se la compró. (The mom bought them it).
¿Me compraste la cosa que quería a mí? Sí, te la compré. (Did you buy me the thing I wanted? Yes, I bought you it.)
Adding pronouns to the end of verbs
Usually the pronouns go before a verb. But, if the verb is in the infinitive, gerund or present participle, or a positive command the pronouns go at the end of the verb. Sometimes you will see pronouns that go with two different verbs, like when you use ir+a+infinitive verb. When pronouns are added to verbs you will usually need to add an accent mark to the verb. It will go on the syllable that would normally be stressed if there were no pronouns.
For example, if I had the verb traer, then I would stress the e in traer. So, when I add pronouns and get something like traérmelas, I need to add an accent on the e.
poner → ponérmelas
poniendo → poniéndolo
haga → hágamelas
Voy a dar el dinero a ti. (I will give you the money.) → Voy a dártelo. or Te lo voy a dar.
One mistake that some people make when learning Spanish is that they think that lo and la mean “it” and le means “him” or “her”. That is not correct. Lo, la, and le can all mean “him”, “her”, or “it”. It all boiled sown to what is happening to the object in the sentence.
La amo. I love her.
Although it is more common for direct objects to be things, it is still common for them to be people.