Variable $x$ cannot be equal to any of the values $2,4$ since division by zero is not defined. Multiply both sides of the equation by $\left(x-4\right)\left(x-2\right)$, the least common multiple of $x-4,x-2$.
Use binomial theorem $\left(a-b\right)^{2}=a^{2}-2ab+b^{2}$ to expand $\left(x-2\right)^{2}$.
$$x^{2}-4x+4=\left(x-4\right)\left(x+4\right)$$
Consider $\left(x-4\right)\left(x+4\right)$. Multiplication can be transformed into difference of squares using the rule: $\left(a-b\right)\left(a+b\right)=a^{2}-b^{2}$. Square $4$.