If your question is "how can I look at this and immediately knowing how to factor this without trying different things?"- sorry, I can't answer that!
But I do know how you can get the factors with a little work.
There are a number of different ways to do it. If we insist upon integer coefficients, then it must be (2x+ something)(x+ something) since "2" can only be factored as 2 and 1. -12 is a bit harder! -1(12), (-2)(6), (-3)(4), (-4)(3), (-6)(2), and (-12)(1) all give -12.
So try them all!
(2x- 1)(x+ 12)= 2x^2- x+ 24x- 12= 2x^2+ 23x- 12. No, that doesn't work.
Keep going!