Transistor confusion
simulate this circuit &ndash; Schematic created using CircuitLab
Figure 1. Make sure that you have a ground connection between the two power supplies.
Without the V1- connection to the 5V- there is no return path for Q1's base current.



simulate this circuit
Figure 2. The circuit re-drawn in the conventional format.
With the redrawn layout it is more clear what is happening.

We can see that R1 is pulling D2 down to ground and that SW1 will pull it high when pressed.
Positive voltages are at the top of the schematic. See +5 V and V1+.
Base resistor added for Q1 to limit the current drawn from D5. Without it the output will be overloaded.
DC motor coil current flows from top to bottom.
It's now very clear that D1 is normally reverse biased (since it's point upwards). It will allow a circulating current through the motor when Q1 switches off. This will protect Q1.
Using the ground symbols makes it instantly clear which points are connected to 0 V and eliminates some wires.