2x refers to "2 times x"... the 2 is the constant coefficient, and you are multiplying that by the term x. You can combine the x terms above as x + 2x = 3x, because the x term is understood to have a 1 in front of it, even though it is not explicitly shown.
To solve your questions, you simply have to combine like terms and then simplify things. So, you have:
x + 12 + 12 + 2x = 42
x + 2x + 12 + 12 = 42
3x + 24 = 42
3x = 18
x = 6