Ci stands in for a place or for an a-phrase already mentioned (a quel problema → ci penso), and ne stands in for a di-phrase or a quantity (di questo → ne parliamo; tre libri → ne ho tre); the phrase they replace is dropped, so you say ci penso, not "ci penso a quel problema". Both sit before the conjugated verb or attach to an infinitive (parlarne, andarci). Beware of fixed verbs like tenerci a qualcosa and volerci, where ci is simply part of the verb and replaces nothing - there the a-phrase can stay (ci tengo alla tua opinione).
Examples
- — Pensi ancora a quel problema? — Sì, ci penso spesso.
- — Are you still thinking about that problem? — Yes, I think about it often.
- — Tieni alla mia opinione? — Sì, ci tengo molto.
- — Do you care about my opinion? — Yes, I care a lot about it.
- — Vuoi parlare della riunione? — Preferirei non parlarne adesso.
- — Do you want to talk about the meeting? — I'd rather not talk about it now.
- — Quanti libri hai letto? — Ne ho letti due.
- — How many books have you read? — I've read two of them.
The mistake to avoid
Don't keep the phrase you just replaced: say ci penso or penso a quel problema, never "ci penso a quel problema" (and with ne + passato prossimo the participle agrees: ne ho lette tre, not ne ho letto tre).
Where this fits in
Stile e registro, Italian C1: Padroneggiare l'italiano idiomatico e formale: espressioni colloquiali, scelte di registro consapevoli, uso di marcatori del discorso e tecniche di attenuazione (hedging) per modulare il proprio messaggio.