Can i ask where the +1 came from (highlighted in red).
That's what was added to "complete" the square.
If we start with the form x^2 + Bx, then we add (B/2)^2 to complete the square.
We do this because x^2 + Bx + (B/2)^2 factors as (x + B/2)^2
Your exercise uses the variable m instead of x.
-m^2 + 2m
This is not in the form x^2 + Bx because of the leading negative sign. So we factor out -1 to start.
-(m^2 - 2m)
Now we have the form x^2 + Bx inside the parentheses, with B=-2. We add (B/2)^2 inside the parentheses.
(B/2)^2 is (-2/2)^2 which is (-1)^2 = 1
-(m^2 - 2m + 1)
Now comes an important part: by adding 1, we have changed the given quadratic. In order to cancel this change (and return to a form equivalent to what we were originally given), we need to add 1 outside.
You might at first think we would need to subtract 1, but remember the -1 that we factored out at first.
-(m^2 - 2m + 1)
The negative sign out front changes the sign of every term inside the parentheses. So the 1 we added inside actually represents a -1. This is why we add 1 outside.
-(m^2 - 2m + 1) + 1
Because we completed the square inside the parentheses, that part now factors as (m+B/2)^2. And B/2 is -1, as we calculated above.
-(m - 1)^2 + 1
Let's verify that this vertex form is equivalent to the original quadratic given, by multiplying everything and simplifying.
-(m^2 - 2m + 1) + 1
-m^2 + 2m - 1 + 1
-m^2 + 2m
It checks.
This page explains the steps and shows graphically why adding (B/2)^2 to the form x^2 +Bx is known as "completing" the square:
https://www.mathsisfun.com/algebra/completing-square.html