Please review - Turn green laser module on/off with arduino

I have a bunch of 330 Ohm - 1/2 watt resistor. Can I use one of these?

Just to understand, what is the purpose of having a resistor between pin 9 and Base?

Thanks for all the help.