8x - 23 = -x + 18 is how I'm interpreting your query.
"the opposite of the number" is slightly confusing, so I'm assuming you mean a negative. If not, please let me know.
We can solve for x using this equation.
8x - 23 = 18 - x
Add x to both sides
9x - 23 = 18
Add 23 to both sides
9x = 41
Divide both sides by 9
x = 4.56