Like terms means terms that have the same variable (and with the same exponent).
A) 9x and 9y <-- those are different variables. This is incorrect.
B) 12ac^2 and ac^2 <-- those are the same variables and same exponent. Correct.
C) 8xy and 8xz <-- different variables, incorrect.
D) ab^2 and x^2y <-- different variables, incorrect.
Correct answer is [tex]\fbox {B)}[/tex]