Coding Help

Hey Guys,
I am working on a project with an old rc car which I have wired up like the attached image below. I need some help with the coding side of things, I have not been able to get any of my codes to work. I would like to be able to send the car off at a certain speed and for a certain amount of time then completely stop. Thanks

Did you want it to do this just once, when you reset the board? Did you want to do this whenever a button is pressed?

How were you planning to specify the speed and time? Will they be hard-wired into the code? Did you want a pot? A web interface? An LCD with a menu?

Because what you have actually asked for is easy:

void setup() {
  analogWrite(A0, 100); // speed 100
  delay(1000L * 2L);  // 2 seconds
  analogWrite(A0, 0); // stop
}

void loop() {
}

But usually the core functionality of code is not difficult. The effort comes in how that functionality gets packaged.