This is a very old-school and technical method we learnt in secondary school. However, many students are unable to do it accurately still. The trick of completing the square is realising that it depends on our (even older) $(a\pm b)^2=a^2 \pm 2ab + b^2$ formula. We are always introducing the $-b^2$ after we complete the square to ensure the expression is kept the same.

Students should know the completing the square is a technique, not confined to just quadratic expressions.

For example,
$5-4\sqrt{x}+x=(\sqrt{x}-2)^2 +1$