Firstly, you can only complete the square on quadratic functions (functions in the form Ax2+Bx+C)
If A=1,
Consider B, the coefficient of x. Substitute it into ( x + (B/2) )2.
We know if we multiply this out, we will get x2+Bx+(B/2)2.
However, we want x2+Bx+C.
We therefore subtract the (B/2)2 we don't want and add the C we do.
This gives us ( x + (B/2) )2 - (B/2)2 + C.
This method is called 'completing the sqaure'
If A does not = 1, manipulate the quadratic so it is in the form A( x2 + (B/A) x + (C/A)). Solve the bracket as normal and multiply through by A at the end.