You find two numbers that add up to the 5 and multiply to the -6 .
It looks like 6 and -1 can do the job ...
adding: 6 + (-1) = 5
multiplying: 6 x (-1) = -6 .
See ? OK. So now, the factors of the expression are
==> (x plus one of the numbers)
and
==> (x plus the other number).
(x + 6) (x - 1) = x² + 5x - 6