To expand on Emerton's answer: Using the excision sequence, Cartan's result in the algebraic case boils down to showing the following: Let $R$ be a regular local ring, and $I$ and ideal of height at least $3$, then $H^i_I(R)=0$ for $i\leq 2$.This follows because: $$H^i_I(R) = lim \ Ext^i(R/I^n,R)$$

And $I^n$, being height $3$, always contains a regular sequence of length $2$, so the $Ext^i$ vanishes for $i\leq 2$ by standard result (see Bruns-Herzog Cohen Macaulay book, Proposition 1.2.10 for example). This argument extends to the case of codimension at least $n$ and vanishing of $H^{n-2}$.

Incidentally, a pretty non-trivial question is to find upper bound for the vanishing of local cohomology modules, in other words, the cohomological dimension of a subvariety $Z$. Many strong results have been obtained after SGA, by Hartshorne, Ogus, Faltings, Huneke-Lyubeznik, etc. All those references can be found in
Lyubeznik's paper (they were mentioned in the very first page) which primarily treated the vanishing of etale cohomology.