Why does $ \lim_{x \to 2} \frac{x^2-4}{x-2} =4 $ if x cannot be 2?
Limits are what a function approaches as $x$ approaches a value, and are do not depend on the value of the function itself. Here, as $x$ becomes arbitrarily close to $2$, $\frac{x^2-4}{x-2}$ becomes arbitrarily close to $4$ and so we say its limit as $x\rightarrow 2$ is $4$. Note that the fact that the function is not defined at $x=2$ is irrelevant.
Here is a picture if that clears things up:
Note that when $x$ is very close to $2$, the function is very close to $4$ even if it's undefined precisely at $2$.
Limit doesn't have to do with the existence of function at that point. In the context of the given problem,
$$f(x) = \frac{x^2-4}{x-2}= \frac{(x-2)(x+2)}{x-2}$$
We study the behavior of $f$ as $x$ approaches a certain point. For example let's study the RHL by considering the value of $f$ at some points:
$$f(2.01) = 4.01$$
$$f(2.001) = 4.001$$ $$f(2.0001) = 4.0001$$
You see how when we move $x$ closer to $2$, $f(x)$ gets closer to $4$. Similarly for the LHL,
$$f(1.99) = 3.99$$ $$f(1.999) = 3.999$$ $$f(1.9999) = 3.9999$$
The same thing happens when we approach $x$ closer to $2$, $f(x)$ gets closer to $4$.
Now in short hand we can do it like this
$$\lim_{x \to 2} \frac{(x-2)(x+2)}{x-2}$$
Now since $ x \neq 2$, $x - 2 \neq 0$. Therefore we can cancel the factor in the numerator and denominator above. Hence we get
$$\lim_{x \to 2} \frac{(x-2)(x+2)}{x-2}$$ $$=\lim_{x \to 2} x+2$$ $$=4$$