I know the following implication holds:

$\lim\_{x \to p} f(x) = A \land \lim\_{x\to p} g(x) = B \land B \ne 0 \implies \lim\_{x\to p} \frac{f(x)}{g(x)} = \frac{A}{B}$.

My question is how much "freedom" we have when computing $\lim\_{x\to p} \frac{f(x)}{g(x)} $in case $B = 0$.

Do I understand correctly that limits are defined for the neighbourhood of $p$, and exclude point $p$? If so, can we then multiply both numerator and denominator by a function which is $0$ only at $p$, but not $0$ when approaching $p$?

For example, does the equality below hold (e.g. in case multiplying by $x-p$ simplifies the expression, such that the limit converges:

$$
\lim\_{x\to p} \frac{f(x)}{g(x)} = \lim\_{x\to p} \frac{f(x) \cdot (x-p)}{g(x) \cdot(x-p)}
$$