I was watching Calculus 1 lectures on Youtube, particularly Professor Leonard's, and I thought I would be able to answer a question on the board very simply, but I've reached quite an odd answer and I can't identify the faulty logic in my way of solving. Here is the question and my steps to solve it:
Evaluate: $$ \lim_{x \to 0} \frac{x^2}{1-\cos(x)} $$
My approach to solving this was to take $ x $ out as a factor, then deal with the two expressions as two limits, and eventually treat the latter as a reciprocal of the fundamental $\lim_{x \to 0} \frac{1-\cos x}{x}= 0$
Steps:
$$ \lim_{x \to 0} \left[x \cdot \frac{x}{1-\cos(x)}\right] $$
$$ \lim_{x \to 0} x \cdot \lim_{x \to 0} \frac{x}{1-\cos(x)} $$
$$ \lim_{x \to 0} x \cdot \lim_{x \to 0} \left(\frac{1-\cos(x)}{x}\right)^{-1} $$
$$ \lim_{x \to 0} x \cdot \left[\lim_{x \to 0} \frac{1-\cos(x)}{x}\right]^{-1} $$
$$ 0 \cdot 0^{-1} = 0 $$
Now I am aware that my answer is mathematically wrong and that the correct limit is 2, but I can't deduce why by using my current knowledge of calculus. I would appreciate it if someone pointed out the reason I can not evaluate this limit this way.

$0/0$ is indeterminate. Use L'Hospital's rule: $$\lim_{x\to 0} \frac{x^2}{1-\cos x} = \lim_{x\to 0} \frac{2x}{\sin x} = \lim_{x\to 0} \frac{2}{\cos x} = \frac{2}{\cos 0} = 2$$