The fact that y varies directly with x means that they have a relation like:
[tex]y=kx[/tex]Where k can be any number. We know that y=6 when x=-2 which means that k is given by:
[tex]\begin{gathered} y=kx \\ 6=-2k \\ \frac{6}{-2}=k \\ k=-3 \end{gathered}[/tex]Then if y=9 we get:
[tex]\begin{gathered} y=-3x \\ 9=-3x \\ \frac{9}{-3}=x \\ x=-3 \end{gathered}[/tex]So x=-3 when y=9.