"We buy him a bottle of wine."
Translation:Gli compriamo una bottiglia di vino.
For first and second person, direct and indirect are the same, so you only have to learn one set. Me is mi, you is ti, us is ci, you-plural is vi.
My mnemonic for the third-person ones is that direct objects are just as you'd want them to be lo is him, la is her, li is them, le is them-female. Indirect objects are all gli except single women, who're le.
The clitic pronouns change depending on how they're used: direct objects or indirect objects. In this case "him" is an indirect object, and it's more evident in Italian: we (subject) buy (verb) a bottle (direct object) [for] him (indirect object) = [noi] (subject) gli (indirect object) compriamo (verb) una bottiglia (direct object). If you were to make the direct object clitic it'd be "la": "la compriamo a lui" (we buy it for him); if you were to make both clitic it'd be "gliela compriamo".
The topic is pretty vast, and it doesn't help that these particles have a lot of uses. This link has a nice quick reference: http://www.uvm.edu/~cmazzoni/3grammatica/grammatica/personalpronouns.html
The real culprit here is the verb "buy"; the sentence needs to be thought of as "we buy FOR him...", and the word "for" automatically makes it an indirect pronoun choice, so "gli" instead of "lo", which is the direct pronoun choice.
"lo" is always either (just) "it" or "him", while "gli" is either "to him" or "for him". There is no "gli" in the direct pronoun tables.
Would you say, "Him we buy a bottle of wine" or "For him we buy a bottle of wine"? Obviously "for him", thus making it indirect, thus making it "gli".
Even I get tricked now and then, but it is the implied use of "to" or "for" that always gets me.
I read a great explanation and if I find the link, I'll send it to you. But basically: to find out if you need a direct object pronoun, ask "(verb) what?" or "(verb) where?" e.g. "The crocodile swallowed the swimmer". Q: Swallowed what? A: the swimmer. So if it's "the crocodile swallowed him" you use the 3rd person singular masc direct object pronoun (in this case, 'lo'). On the other hand, if you ask "(Verb) to?" or "(Verb) for what?"or "(Verb) whom?" you use an indirect object pronoun. E.g.: "Scrooge left all his money to his nephews." Q: left it to whom? A: his nephews so in "he left it to them" you use the 3rd person plural masc indirect object pronoun which in this case, if I'm not mistaken, is gli. Now, I'm having a really hard time getting on top of these clitics, but I'm getting, there, I think. Subject pronouns you already know - I, you, he/she/it, we, you, they. Courage, dyn! Remember Rorke's Drift!
Lucia - Of course you can skip it (just get through the first section, so that the next topic is unlocked) but you will never be able to get by as a tourist without arm-waving, pointing and horrible misunderstandings if you do. My advice is don't skip it, but move on and keep going back to it. Sooner or later it will all click, and you will wonder what the problem was. Do a spot of judicious cheating (cut'n'paste) if something completely foxes you and you just can't get it right, so that you get some sense of progress. But I promise it will all become clear, eventually. Good luck