−5x2 and x12x–––––––––––––––––
x12x can be simplified as 12x2.
Now, −5x2 and 12x2 have the same variable and same corresponding exponents, hence, they are like terms.
16p3 and −3p16––––––––––––––––––
They have same variables but different exponents, hence, are unlike terms.
−2a3b4 and −4a3––––––––––––––––––––
They have different variables as well as different exponents, hence, are unlike terms.