"How they got" that factor isn't (per se) relevant to how you should proceed, but I'll tell you anyway
There's a result known as the "rational root theorem" which gives us a finite amount of possible linear factors to check.
There's also calculators, which can crank out solutions (factors) in no time.
The big picture is:
a) you know how to factor/solve quadratics
b) this is a cubic
c) dividing a cubic by a (given) linear factor will produce a quadratic, which you know how to factor!
So we proceed with synthetic division. Set x - 2 = 0 to get x = 2 as the number "in the box"
 4 15 -31 -30
......... 8_ 46_ 30
....4... 23.. 15 ...|0|
Now your quadratic is