If n is the first integer, then n+2 is the second one. The equation for the sum can be written as
n + (n+2) = 24 . . . . . . this equation can be used to solve the problem
2n = 22 . . . . . . . . . . . simplify, subtract 2
n = 11
The integers are 11 and 13.
_____
I like to solve problems like this by looking at the average of the integers. Here, it is 24/2 = 12. The consecutive odd integers whose average is 12 are 11 and 13.