Then, you place the sign of the second term (the x term) in the first parenthesis.
(x+ )(x )=0
Next, you multiply the signs of the x term and the sign of the constant (the third term). Since + × - = -, then you place a -.
(x+ )(x- )=0
You look at the constant (-18) and the second term (3). What two numbers multiplied give you -18 but subtracted (since the signs inside the parenthesis are opposite) give you 3? Those numbers are 6 and 3. Since the result of the substraction need to be 3, you place the 6 with the + sign and the 3 with the negative sign (if you think of it, 6-3=3 but 3-6 = -3. That's the reason behind placing the numbers)