When you put together the breadboard, there are two things to look out for.
Firstly, make sure that the transistor is the right way around. The flat side of the transistor should be on the right-hand side of the breadboard.
Secondly the striped end of the diode should be
towards the +5V power line - see the image below!
The motor can be connected either way around.