First test for linearity. Take two x-y pairs and find the slope.
Slope=(-9-(-21))/(0-(-2))=12/2=6.
Slope=(-3-(-9))/(1-0)=6.
Also (-3-(-21))/(1-(-2))=18/3=6.
We have a linear relation between x and y and we can write y=6x+b and since y=-9 when x=0, b=-9 so the rule is y=6x-9. When x=3, y=9.