Control Relay using single push button

Hello everyone. Here i want to ask some question. How to communicate an arduino with the relay using a single push button. Please please help me.. I am a new here.

Thank you.

What have you tried?

Hint: posting the same question multiple times pisses people off. Don't do it

const int proxswitchPin = 2; // the number of the pushbutton pin
const int airval1 = 4; // the number of Plunger valve 1 pin
const int airval2 = 7; // the number of Part release after plunger valve 2 pin
const int airval3 = 8; // the number of Part release into plunger valve 3 pin

// variables will change:
int proxswitchState = 0; // variable for reading the pushbutton status

void setup() {

pinMode(airval1, OUTPUT); // initialize airval1 pin as output
pinMode(airval2, OUTPUT); // initialize airval2 pin as output
pinMode(airval3, OUTPUT); // initialize airval3 pin as output
// initialize the pushbutton pin as an input:
pinMode(proxswitchPin, INPUT);
}

void loop() {
// read the state of the pushbutton value:
proxswitchState = digitalRead(proxswitchPin);

// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (proxswitchState == HIGH) {
delay(100); // Delay to make sure part is in write position before assembly
digitalWrite(airval3, HIGH); // Bring cylinder up to hold second part in line in place while first one drops
digitalWrite(airval1, HIGH); // Activate Plunger
delay(50); // Delay to make sure plunger goes all the way down
digitalWrite(airval1, LOW); // Bring plunger back up
digitalWrite(airval2, HIGH); // Open gate for part to fall off chute
delay(500); // Delay to make sure part has time to fall
digitalWrite(airval2, LOW); // Close gate after part falls
delay(00); // Delay after part drop off chute to make sure gate is closed
digitalWrite(airval3, LOW); // release part to get assembled
}
else {
digitalWrite(airval2, LOW); // Leave gate open for parts to fall into plunger area
digitalWrite(airval3, LOW); // Leave gate closed so parts stop in plunger area
}
}

I'm already try this source code, but it not function properly.

Another thing that pisses people off is noobs who think the posting guidelines don't apply to them.

It hasn't been a good start, has it?

This code looks very familiar. Have you previously posted a query about counting the number of times the proximity switch detects an item and stopping when it reaches 101 ?

Found it Add counter and push button reset to arduino uno R3 - #7 by UKHeliBob - Programming Questions - Arduino Forum

If you want to use a relay and a push button, why in you're code I see 3 air valves (not relays) ad a proximity switch (not push button)?

So, or tell use exactly what you want to do, NOT what you think you need to do. Or make a simple example that indeed DOES what you ask use and learn from that. But I think the first is the best for now.

Also, use code tags!