basic relay control

Hello. How can i run this two loops (relay 1+2 and 3+4) at same time?

int relayPin1 = 5; // IN1 connected to digital pin 5
int relayPin2 = 6; // IN2 connected to digital pin 6
int relayPin3 = 7; // IN3 connected to digital pin 7
int relayPin4 = 8; // IN4 connected to digital pin 8

void setup()
{
pinMode(relayPin1, OUTPUT); // sets the digital pin as output
pinMode(relayPin2, OUTPUT); // sets the digital pin as output
digitalWrite(relayPin1, HIGH); // Prevents relays from starting up engaged
digitalWrite(relayPin2, HIGH); // Prevents relays from starting up engaged

}

void loop()
{

digitalWrite(relayPin1, LOW);
delay(2500);
digitalWrite(relayPin1, HIGH);
delay(2500);
digitalWrite(relayPin2, LOW);
delay(2500);
digitalWrite(relayPin2, HIGH);
delay(2500);
}

void setup ()
{
pinMode(relayPin3, OUTPUT); // sets the digital pin as output
pinMode(relayPin4, OUTPUT); // sets the digital pin as output
digitalWrite(relayPin3, HIGH); // Prevents relays from starting up engaged
digitalWrite(relayPin4, HIGH); // Prevents relays from starting up engaged

}

void loop ()
{

digitalWrite(relayPin3, LOW);
delay(500);
digitalWrite(relayPin3, HIGH);
delay(500);
digitalWrite(relayPin4, LOW);
delay(500);
digitalWrite(relayPin4, HIGH);
delay(500);
}

How can i run this two loops (relay 1+2 and 3+4) at same time?

The answer is yes. See Several things at the same time

Why did you hijack an existing thread instead of starting a new one to avoid confusion ?

Combining sketches.

Combining the sketches is not really the problem because if the OP manages that then he will quickly discover that his use of delay() will prevent it doing what he wants.

I am not so sure what the OP wants. Covering a base.