Help programming a delay in Arduino

Hello, I have a few beginner questions hopefully yall can help me with. I need to program my arduino to delay 45 seconds before sending power to the motor. I have it programmed and wired now so that it turns the motor on as soon as I plug in the 9V battery. I've included pictures and a copy of the code I'm using now to help clarify what's going on. If anybody could help me with the programming I'd appreciate it. Thanks!

const int motorPin = 3;
const int buttonPin = 8;
int buttonState = LOW;

void setup()
{
pinMode(motorPin, OUTPUT);
pinMode(buttonPin, INPUT);
}

void loop() {
buttonState = digitalRead(buttonPin);
if (buttonState == HIGH) {
delay(2000);
digitalWrite(motorPin, HIGH);
}
else {
delay(2000);
analogWrite(motorPin, LOW);
}
}

If anybody could help me with the programming I'd appreciate it.

Just add delay(45000); to setup().

      digitalWrite(motorPin, HIGH);
  }
  else {
    delay(2000);
         analogWrite(motorPin, LOW);

Digital write it HIGH and analog write it LOW. Makes sense to me. Not!

Digital write it HIGH and analog write it LOW.

Perverse, yes, but analogWrite(...,LOW) just does a digital write (..., LOW) anyway.

I appreciate the response. Wasn't really sure where to go from there. This is my first time using Arduino. After a lot of research I've found a tutorial about how to delay an LED. Using pin 13 and GND i can program the LED to turn on and off when I want it to. I thought that plugging the motor into those pins would work, however I've realized I will need to use either a Relay or a transistor/resistor combo. I've tried using the transistor and resistor on a breadboard to no avail. How would I use a 9v relay to make this work?

int led = 13;

void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}

void loop() {
delay(10000);
digitalWrite(led, HIGH);
}

How to connect a relay to an Arduino:

After a lot of research I've found a tutorial about how to delay an LED.

A lot of research? That example is supplied with the IDE, along with a lot of others. It's not even a very good example, since it teaches bad habits. The blink without delay example is far better.