It's easy enough to check the answers by multiplying the factors together. Only choices A and B have constants that multiply to give 32.
When you add the "Outer" and "Inner" terms of choice A, you get
... 8p + 4p = 12p . . . . . does not match the original expression
When you do the same for choice B, you get
... 16p + 2p = 18p . . . . matches the original expression
The appropriate factorization is
... B. (p + 2)(p + 16)
_____
If you want to start from the expression and arrive at factors, you will be looking for two numbers that multiply to give 32 and add to give 18. Since both of these numbers are positive, you are looking for positive numbers.
... 32 = 1×32 = 2×16 = 4×8 . . . . . sums of these factors are 33, 18, 12
The middle pair of factors has a sum of 18, so these are the ones that go into the binomials that factor the expression:
... p² +18p +32 = (p +2)(p +16)
_____
In case you're wondering why this works, consider the general case:
... (p +a)(p +b) = p² +(a+b)p +a·b
The constants in the binomial factors are "a" and "b". The coefficient of p in the trinomial expression is their sum (a+b), and the contant is their product (a·b).