We can split the m-8 into 2 terms m and -8 each multiplying the next ( ) like this...
m(m+5)-8(m+5)
Now we expand
m^2+5m-8m-40
then simplify!
m^2-3m-40
Done!
If you have any more questions put them in the comments and brainliest will be appreciated