Well you can try guessing but...
$23^2 = (2\times b + 3)^2 = 4b^2 + 12b + 9$
And $562 = 5b^2 + 6b + 2$.
So $4b^2 + 12b + 9 = 5b^2 + 6b + 2$.
We have several options now.
Maybe straightforward is simply solve the quadratic.
$b^2-6b-7 = 0$ so $b =\frac {6\pm \sqrt{36+4\cdot 7}}2 = -1, 7$ so $b=7$.
....
But that doesn't really teach us to think like number theorists.
We do knot that if $23_b = X$ then $X \equiv 3\pmod b$ and $X^2 \equiv 9\pmod b$.
But $X^2 = 562_b$ so $X^2\equiv 2\pmod b$. So $2 \equiv 9\pmod b$. So $2$ and $9$ differe by a multiple of $b$. That is $b| 9-2=7$ so $b|7$ but $7$ is prime so $b = 7$ is the only option.
We can verify $b=7$ works for the rest....
.....
Alternatively to get a look at "what is going on" we see that
$562_b = 5b^2 + 6b + 2$. But $23_b^2 = 4b^2 + 12b+9$
So we have $5b^2 + 6b + 2 = 4b^2 + 12b +9$.
$5b^2 + 6b + 2 = 562_b$ is the "correct" written which means that $4b^2 + 12b+9$ is "out of balance and we need to carry or borrow somehow.
So we need to turn $4b^2 + 12b + 9$ into $5b^2 + 12b + 9$ by borrowing or carrying.
$4b^2 + 12b + 9=$
$5b^2 - b^2 + 12b + 9 =$
$5b^2 - b\cdot b + 12b + 9 = $
$5b^2 + (12-b)b + 9$.
Now we need to turn $(12-b)b$ to $6b$ by borrowing and carrying.
$5b^2 + (12 - b)b + 9 = $
$5b^2 + (6 + 6-b)b + 9 = $
$5b^2 + 6b + [9 + (6-b)b]$.
This leaves us with $9 + (6-b)b = 2$ and we can solve for $b$ with the quadratic equation.
But it probably have been easier if back when we had
$5b^2 + (12-b)b + 9$ if we had realized we have to turn the $9$ into a $2$.
$5b^2 + (12-b)b + 9=$
$5b^2 + (12-b)b + (7+2) =$
$5b^2 + (12 - b+\frac 7b)b + 2$
So $12 - b + \frac 7b = 6$.
Now $\frac 7b$ must be an integer so we must have $b|7$ so we must have $b=1$ or $7$ and if we have $b = 7$ we get $12 - 7 +\frac 7b = 6$
....
or we could have gone the other way from the start.
$4b^2 + 12b + 9 = 5b^2 + 12b + 9$ so
$4b^2 + 12b +9 = $
$4b^2 + 12b + (7+2) =$
$4b^2 + (12 + \frac 7b)b + 2=$
$4b^2 + (6+\frac 7b + 6)b + 2 =$
$(4+\frac 6b + \frac 7{b^2})b^2 + 6b +2=$
$5b^2 + 6b + 2$ if and only if
$\frac 6b + \frac 7{b^2} = 1$.
So $6b + 7 = b^2$. So solve for $b$ and we $b = 7$ or $b=-1$.
....
However you do it though, the key is we have $23^2 = 4b^2 + 12b +9= 5b^2 + 6b + 2$ so we must have $9\equiv 2\pmod b$ and that limits what $b$ can be (in this case $b$ must be $7$)