Note that the polynomial $ a^2-2ab+b^2 $ is a perfect square trinomial, so we will use the following formula.
$$ A^2 - 2AB + B^2 = (A - B)^2 $$In this example we have $ \color{blue}{ A = a } $ and $ \color{red}{ B = b } $ so,
$$ a^2-2ab+b^2 = ( \color{blue}{ a } - \color{red}{ b } )^2 $$