Pneumatic cylinders with sensors with Arduino Uno
void loop() {

...

  if(digitalRead(dvereVysunute) == HIGH &amp;&amp; digitalRead(davkovaniZasunute) == HIGH
  )
  {
      digitalWrite(davkovani, LOW);      // extend the second pneumatic cylinder
      delay(4000);
      digitalWrite(davkovani, HIGH);    // retract the second pneumatic cylinder after 4 seconds, 
      // this code works when it is alone there, the next if statements not
  }

...
}


If the condition is met, then davkovani is going to be LOW 99.999% of the time. It will only briefly go HIGH, as there is no delay there. The loop will iterate and set it LOW again. So it may seem to be "not working" whereas the problem is that it "works" very briefly.