Can you explain how to complete the square?

x^2 -y^2 - 2x +4y-6=0

x^2 - y^2 - 2x + 4y - 6 = 0

First, rearrange the terms as such:
x^2 - 2x - y^2 + 4y = 6
We can put parenthesis to separate all terms with x from all terms with y.
(x^2 - 2x) + (-y^2 + 4y) = 6
Notice that the coefficient of y^2 is negative. We can factor out -1 so we'll have
(x^2 - 2x) - (y^2 - 4y) = 6
To complete the square, take the numerical coefficient of the variable with degree 1 (which is x and y). Then we divide it by two, and square it. Finally we add it as the constant to complete the square.

Let's have an example first. For instance, we have x^2 + 6x. The numerical coefficient of x is 6. We divide it by two, we'll have 6/2 = 3, and we square it, we'll have 3^2 = 9. We add nine to the expression, but subtract the nine outside the parenthesis so that it will counter the effect of the 9 we added inside the parenthesis:
(x^2 + 6x + 9) - 9
Then factor the quadratic expression. It becomes (x+3)^2 - 9.

In the problem,
(x^2 - 2x) - (y^2 - 4y) = 6
Numerical coefficient of x is -2. -2/2 = -1. (-1)^2 = 1
Numerical coefficient of y is -4. -4/2 = -2. (-2)^2 = 4
(x^2 - 2x + 1) - (y^2 - 4y + 4) - 1 + 4 = 6
(x - 1)^2 - (y - 2)^2 = 6 + 1 - 4
(x - 1)^2 - (y - 2)^2 = 3

hope this helps~ `u`