Construct the circuit below. Note that you will need a limiting resistor for each LED. Also, look at the datasheet for your transistor. If you are using real hardware, the pins on the transistor might be different than what's shown in the simulator diagram.

Copy in the following code:

const int led_pin = 6;

void setup() {
  pinMode(led_pin, OUTPUT);
}

void loop() {
  digitalWrite(led_pin, HIGH);
  delay(500);
  digitalWrite(led_pin, LOW);
  delay(500);
}

Simulator: https://tinkercad.com/things/ewXzXzhI0Au