Start first with the fact that division is continuous wherever defined. This means, if $\lim_{x\to a}f(x)=F\in\mathbb R$ exists, and $\lim_{x\to a}g(x)=G\in\mathbb R, G\ne 0$ exists and is nonzero, then $\lim_{x\to a}\frac{f(x)}{g(x)}$ exists and is equal $\frac{\lim_{x\to a}f(x)}{\lim_{x\to a}g(x)}=\frac{F}{G}$.
This is a theorem that can be rigorously proven. You can use it to reduce calculation of $\lim_{x\to a}\frac{f(x)}{g(x)}$ to calculation of $\frac{\lim_{x\to a}f(x)}{\lim_{x\to a}g(x)}$.
Nice. So this works a lot of times, but breaks down if one of the limits does not exist in $\mathbb R$. It also breaks down if $G=0$. My guess is that you are mostly interested in the latter case, but it is worth talking about other cases as well. So: what happens when the conditions of the above theorem are not satisfied, e.g. when $G=0$ or one of the above limits does not exist as a real number?
The answer is: then, simply, you cannot use the above theorem! The above theorem does not help decide if the limit exists, and, even if yes, it does not help calculate the limit.
What do you do, then? You have various choices:
Transform your expression to another form. In your case, the expression for $x\ne 2$ are the same as the expression $\frac{x-1}{x+2}$ (cancelling $(x-2)$), so it must have the same limit, while the latter limit $\lim_{x\to 2}\frac{x-1}{x+2}=\frac{2-1}{2+2}$ can be easily calculated using the above theorem (essentially).
Use a "stronger" theorem, e.g. L'Hopital rule. (Saying "stronger" in quotes: it is not really stronger in the strict sense, but in this case it can be used, unlike the theorem above.)
A special case of the previous: there are (additional) theorems that claim something about the limit of $\frac{f(x)}{g(x)}$ if one of those limits is a real (nonzero or not) number (from $\mathbb R$) and the other is $+\infty$, $-\infty$ or $\infty$. (With appropriate understanding what $\lim_{x\to+\infty}$, $\lim_{x\to-\infty}$ and $\lim_{x\to\infty}$ means.)
The above picture is the full background to it. It does not invoke "indeterminate forms". It does not require you to write $\frac{0}{0}$ and then ponder what that might mean. We don't divide by zero anywhere. It is just the case where $\lim_{x\to a}g(x)=0$ is out of scope of the above theorem.
However, it is very common, in mathematical education, to talk about "indeterminate forms", "undefined forms" and the like, as a way to classify the cases when the above theorem cannot be applied. That is the only sensible way to interpret the symbol $\frac{0}{0}$ - as a symbol for one of the cases where the theorem cannot be applied, namely the case where the limits of the numerator and denominator are $0$.