First project - help with code and vibration motor

Yes, I’m really struggling with that. It’s marked bc337 but I’ve seen that unit used for other purposes with different pins. It’s also too fiddly. I’ve just ordered some TIP120 replacements that seem clearer