Step 1: Separate the two jobs a substituent can do.
A group attached to benzene can influence the ring in two independent ways, through the inductive effect working via the sigma-bond framework, and through resonance working via the pi-electron system. These two effects do not have to point the same way, and chlorine is the classic example of that.
Step 2: Explain the deactivation through the inductive effect.
Chlorine is strongly electronegative, so it constantly pulls electron density away from the ring through the sigma bond. This lowers the overall electron density everywhere on the ring, which is exactly why chlorobenzene reacts more slowly than benzene itself in electrophilic substitution, chlorine deactivates the ring.
Step 3: Explain the directing behaviour through resonance.
Even though chlorine withdraws density inductively, it still carries lone pairs of electrons that it can donate into the ring through resonance. Drawing out the resonance structures shows this donation specifically piles up extra electron density at the ortho and para positions, and also stabilises the arenium ion intermediate formed when an electrophile attacks at those very positions.
Step 4: Reconcile the two effects.
The inductive effect is stronger overall, so it wins the battle for reactivity and chlorobenzene stays deactivated. But for orientation, it is the resonance donation that wins, since it selectively stabilises attack at ortho and para carbons much more than at the meta position. That is how chlorine ends up deactivating yet still directing to ortho and para.
\[ \boxed{\text{The } -I \text{ effect deactivates the ring, but the } +R \text{ effect of chlorine's lone pairs directs incoming groups to ortho and para}} \]