Indirect objects are the people or things in a sentence to or for whom/what* the action of the verb occurs.
I'm talking to Pierre.
Je parle à Pierre.
To whom am I talking? To Pierre.
He buys books for the students
Il achète des livres pour les étudiants.
For whom does he buy books? - For the students.
*"For" only in the sense of a recipient (I bought the gift for you), not when it means "on behalf of" (he speaks for all the members).
Indirect object pronouns are the words that replace the indirect object, and in French they can only refer to a person or other animate noun.(1) The French indirect object pronouns are
me / m' me
te / t' you
lui him, her
Me and te change to m' and t', respectively, in front of a vowel or mute H.
Like direct object pronouns, French indirect object pronouns are usually(2) placed in front of the verb.
I'm talking to him.
Je lui parle.
He buys books for them.
Il leur achète des livres.
I'm giving the bread to you.
Je vous donne le pain.
She wrote to me.
Elle m'a écrit.
Notes: When deciding between direct and indirect objects, the general rule is that if the person or thing is preceded by the preposition à or pour, that person/thing is an indirect object.(1) If it's not preceded by a preposition, it is a direct object. If it's preceded by any other preposition, it can't be replaced by an object pronoun. For more information, please see direct vs indirect objects.
(1) In English, an indirect object can be animate or inanimate. This is also true in French; however, an indirect object pronoun can replace the indirect object only when it is an animate noun: person or animal. When you have an indirect object that's not a person or animal, it can only be replaced with the adverbial pronoun y. So "pay attention to him" would be fais attention à lui, but "pay attention to it" (e.g., the program, my explanation) would be fais-y attention - learn more.
(2) With most verbs(3) and in most tenses and moods(4), when the indirect object pronoun is first or second person, it has to precede the verb:
He's talking to me = Il me parle, not "Il parle à moi"
When the pronoun refers to the third person, you can use a stressed pronoun after the verb and the preposition à in order to stress the distinction between masculine and feminine:
I'm talking to her = Je lui parle, à elle
(3) However, with some verbs the indirect object pronoun has to follow the verb - see verbs that don't allow a preceding indirect object pronoun.
(4) The imperative has different rules for word order.
Test on indirect object pronouns