Need code help for school project

That would be my recommendation. If you really would like to start with an if-statement:
what is the boolean expression in the if-statement?

As a first step describe in normal words what the boolean expression says

I can I have time around that time. And well the boolean expression would if something happens/changes it’s going to do what we tell it. Atleast those are my normal words.

Edit:Also I can’t post any more replies because I’m a new user and in my device it should be time , distance, servo position, servos, and trig and echo pins for the ultrasonic sensors.

Yes. So get more concrete. What variables make sense?
A nonsense example measuring the color of your t-shirt makes really no sense.

But what makes sense to measure?

Hi t_h,

i sended you a private message with some links to use. Take a look into your private messages
best regards Stefan

Take a look into this tutorial:

Arduino Programming Course

It is easy to understand and has a good mixture between explaining important concepts and example-codes to get you going. So give it a try and report your opinion about this tutorial.