Quante ne vuoi? The question was Italian. Then ho due goes back across the table, and that is not, because Italian wants ne ho due and will not do without it. In English “I have two” is a complete sentence and “of them” is optional padding you drop without losing anything. In Italian the ne is not padding. It is the part of the sentence that says two of what. The mirror mistake goes the other way: ne penso for “I think about it”, where the Italian wanted ci penso, and two small words that look interchangeable turn out not to be.
Both words stand in for a phrase you have already said, and the preposition of that phrase decides which one you get. Ci takes over a phrase built with a, in, su, con or da: vado a Roma becomes ci vado, penso al lavoro becomes ci penso, credo a questa storia becomes ci credo, and vado da Maria becomes ci vado as well, because da names a place here as much as a does. Ne takes over a phrase built with di, and that includes the di hidden inside a quantity: parliamo del film becomes ne parliamo, ho due libri becomes ne ho due. Both of them sit in front of the verb in an ordinary sentence, and both attach to the end of an infinitive or an imperative: voglio andarci, parlarne, vacci, prendine due.
Ci vado domani.
Ne ho due.
Non ci penso mai.
Che ne pensi?
Ne parliamo domani.
One verb, two prepositions, two different questions, and that is the pair to keep hold of. Pensare a is having something in mind, so ci penso is I am thinking about it. Pensare di is having a view on something, so che ne pensi is what is your opinion. The verb gives you no help at all; the preposition you would have used decides, and ci and ne are both correct with pensare depending on which sentence you were making.
The edge that trips people up
One of these words has been swallowed whole by a handful of verbs, which no longer mean anything without it. Ci vuole un’ora, it takes an hour. Ci metto un’ora, I take an hour to do it. Non c’entra niente, that has nothing to do with it. Me ne vado, I am off. Non ne vale la pena, it is not worth it. In none of these can you point at the phrase the ci or the ne replaced, and trying to derive them from the rule above produces nothing usable.
Non c’entra niente, e comunque non ne vale la pena.
These are learned as whole verbs, the way you learned mi piace, and the list above does not close. That is the honest version. There is no test that tells you entrarci exists, and no pattern that generates me ne vado from andare. What the rule gives you is every ordinary sentence, which is most of them, and the idioms arrive one at a time as you meet them.
Ci metto mezz’ora ad arrivare.
How to hear it
The preposition is the thing to hold on to, because it is the word that decides this and nothing else in the sentence does. A, in, su, con, or a place named with da: ci. Di, or a number, or un po’: ne. Those two lines cover the ordinary sentence and they are not a complete procedure, because the preposition is sometimes not one you would have thought to use, and because the verbs above have swallowed theirs. What they do give you is a question with an answer, which is better than a guess between two words that sound equally plausible.
The case to watch is the one where English has nothing at all in the place Italian wants ne. Quanti anni hai? and the answer ne ho trenta. Vuoi del pane? and the answer ne voglio un po’. In English those are “I’m thirty” and “I want some”, with no gap anywhere to remind you that a word is missing. Nothing in the English sentence goes wrong when you drop it, so nothing in your ear objects when you drop it in Italian either.
The asymmetry there is between the two languages, not between the two words. English builds a sentence that is already complete with the phrase left out, so “I am thirty” and “I want some” are finished thoughts and nothing in them is standing in for anything. Italian builds one that is complete only with the phrase present or a word holding its place. In ne ho trenta the ne holds the place of anni, and Italian keeps that place filled.