One of our first clues in factoring this expression is that the first and last terms are perfect squares:

#sqrt(m^2) = m#

and

#sqrt(25y^2) = 5y#

In the most general case, we are looking for a solution in the form of

#(am+by)(cm+dy) = m^2-10my+25y^2#

#acm^2 + (bc+ad)my + bdy^2 = m^2-10my+25y^2#

From the first term we can see that #a*c = 1#. Assuming #a# and #c# are integers, they must be both either #+1# or #-1#. Let's make them #+1# for now and continue (it actually doesn't matter which we choose at this point - can you see why?):

#m^2 + (b+d)my + bdy^2 = m^2-10my+25y^2#

From the last term we see that #b*d = 25#. From the second term, we must also have #(b+d) = -10#. The obvious solution for this is to have #b=d=-5#. Therefore we have the solution

#(m-5y)(m-5y) = m^2-10my+25y^2#

Once we have worked through this type of problem, we could have probably started by guessing this solution from the first two observations.