Help needed to convert/amplify PWM output from arduino Pin 9

Did not know that my posts are limited. As I said I am new here.
2SD313 transistor 2SD313 Pinout, Equivalent, Features, Applications and More
Or should I use the PN2222A? Temp sensor DS18B20 - Waterproof 1-Wire DS18B20 Digital temperature sensor : ID 381 : $9.95 : Adafruit Industries, Unique & fun DIY electronics and kits