In: Physics
I made the below circuits on Fritzing.
The transistor I have used is an NPN transistor and resistors at base and collector terminal with the LED. I have labeled the diagram (transistor terminals, resistor, and LED legs) to avoid confusion.
The two digital pins that I have used are pin13 which is connected to the base of the NPN transistor via 1KΩ resistor. This resistor limits the current flow through the base terminal. The other digital pin is pin5, this pin is connected to the +ve terminal of led, which is then connected to the NPN transistor's collector terminal via 330Ω resistor (this resistor limits the amount of current flow through the LED).
So, to turn on the LED digital pin5 and pin13 they both need to be in HIGH state. Or you can simply keep pin5 in HIGH state and toggle pin13 to HIGH or LOW state to turn led on/off, this way the transistor acts as a switch.
The motor question does not ask for any detailed connection so the motor can simply be connected to 5V pin and GND pin of the arduino.
Note: Connecting a motor directly to your Arduino board in real life can damage the Arduino board. Because motors draw a lot of current. If you are planning on making something that involves motors I'll recommend using a motor driver with the Arduino board.