Consider the limit
$$
\lim_{x\to a}\frac{f_1(x)+\ldots+f_m(x)}{g_1(x)+\ldots+g_n(x)}
$$
and suppose that
$$
\lim_{x\to a}f_i(x)=\lim_{x\to a}g_j(x)=0,\qquad\forall i=1,\ldots,m,\ j=1,\ldots,n.
$$
Moreover, suppose that
\begin{align}
&\forall i=1,\ldots,m,\ \exists h_i\in\mathbb{N}:\ \lim_{x\to a}\frac{f_i(x)}{(x-a)^{h_i}}=p_i\in\mathbb{R}-\{0\},\\
&\forall j=1,\ldots,n,\ \exists k_j\in\mathbb{N}:\ \lim_{x\to a}\frac{g_j(x)}{(x-a)^{k_j}}=q_j\in\mathbb{R}-\{0\}.
\end{align}
We can informally say that $f_i$ is an infinitesimal of order $h_i$ in $a$, and $g_j$ is an infinitesimal of order $k_j$ in $a$ (with respect to $x-a$).
If in the numerator there is one term, say $f_r$, such that $h_r$ < $h_i,\ \forall i=1,\ldots,m,\ i\neq r$, and the same happens in the denominator for, say, $k_s$ then we can write
\begin{align}
&\lim_{x\to a}\frac{f_1(x)+\ldots+f_m(x)}{g_1(x)+\ldots+g_n(x)}=\\
&\qquad=\lim_{x\to a}\frac{\dfrac{f_1(x)}{(x-a)^{h_r}}+\ldots+\dfrac{f_m(x)}{(x-a
)^{h_r}}}{\dfrac{g_1(x)}{(x-a)^{k_s}}+\ldots+\dfrac{g_n(x)}{(x-a)^{k_s}}}\cdot
\frac{(x-a)^{h_r}}{(x-a)^{k_s}}=(*).
\end{align}
We see that the in numerator of the first factor, all ratios go to $0$, except that involving $f_r$, and the same in the denominator for $g_s$, so
$$
(*)=\lim_{x\to a}\frac{\dfrac{f_r(x)}{(x-a)^{h_r}}}{\dfrac{g_s(x)}{(x-a)^{k_s}}}\cdot
\frac{(x-a)^{h_r}}{(x-a)^{k_s}}=\lim_{x\to a}\frac{f_r(x)}{g_s(x)},
$$
and this should answer to the question on how to eliminate unneeded terms in numerator and/or in denominator. Moreover, using previous knowledge, we can also say that
$$
(*) = \frac{p_r}{q_s}\lim_{x\to a}(x-a)^{h_r-s_s},
$$
that is a limit pretty easy to calculate.
Be aware that if you have more than one term of minimal order, you cannot apply the preceeding reasoning, because the sum of terms of order $n$ can have an order higher than $n$, e.g.
$$
\lim_{x\to 0}\frac{\sin(x)-x-x^2}{x^2+x^3}\neq\lim_{x\to 0}\frac{\sin(x)-x}{x^2}
$$
because $\sin(x)-x$ is of order $3$, despite both $\sin(x)$ and $x$ are of order $1$, so the correct elimination is
$$
\lim_{x\to 0}\frac{\sin(x)-x-x^2}{x^2+x^3}=\lim_{x\to 0}\frac{-x^2}{x^2}
$$
Example
Calculate the following limit
$$
\lim_{x\to0}\frac{x^2+2\sin(x^2)+3\sin^3(x)+4\tan(x)+5\log^2(x+1)}{3\cos(x)-3+\arcsin(x)+\log(1-x^2)}=(**)
$$
We can observe that
\begin{align}
& \lim_{x\to0}\frac{x^2}{x^2}=1\neq0 \\
& \lim_{x\to0}\frac{2\sin(x^2)}{x^2}=2\lim_{t\to0}\frac{\sin(t)}{t}=2\cdot1=2\neq0 \\
& \lim_{x\to0}\frac{5\log^2(1+x)}{x^2}=5\left(\lim_{x\to0}\frac{\log(1+x)}
{x}\right)^2=5\cdot1^2=5\neq0 \\
& \lim_{x\to0}\frac{3\cos(x)-3}{x^2}=-3\lim_{x\to0}\frac{1-\cos(x)}{x^2}=-3\cdot\frac{1}{2}=-\frac{3}{2}\neq0
\end{align}
so all these terms are of order $2$. Next, we have
\begin{align}
& \lim_{x\to0}\frac{3\sin^3(x)}{x^3}=3\left(\lim_{x\to0}\frac{\sin(x)}{x}\right)^3=3\cdot1^3=3\neq0 \\
\end{align}
so this term is of order $3$. Finally
\begin{align}
& \lim_{x\to0}\frac{4\tan(x)}{x}=4\lim_{x\to0}\frac{\tan(x)}{x}=4\cdot1=4\neq0 \\
& \lim_{x\to0}\frac{\arcsin(x)}{x}=1\neq0
\end{align}
so these two terms are of order 1, the lowest in the numerator and also the lowest in the denominator, so
$$
(**)=\lim_{x\to0}\frac{4\tan(x)}{\arcsin(x)}
$$