the answers are in the back of my book wich are {-6, 6} but I don't know how they got them

The two bars on either sides of the letter W, means absolute value. This means that W has two values, one on either side of the number line, from
**0** to a specific **unit(s)** on the **right** and
**0** to a specific **unit(s)** on the **left.**

Therefore, we have

i) w+3=9 and

ii) -w+3=9.

Solving for w in (i) above, we have w=9-3

w=6.

Solving for w in (ii) above, we have -w=9-3

-w=6, but w must be positive so dividing through by -1, yields

w=-6

Hence the answer {-6,6}