The remainder theorem lets you find the remainder when a polynomial is divided by a linear function like the above, without actually doing the division.
It states that when the polynomial f(x) is divided by x - a then the remainder is f(a)
Applying it to the items in your question x - a = x + 2 so -a = 2 and so a = -2 :-
f(-2) = 2(-2)^3 - 3(-2)^2 - 5(-2) + 23 = 5 so the remainder will be 5.
Note if the remainder had been 0 then x + 2 would have been a factor of f(x). This process can be used to find if x - a is a factor.