Momentary output signal

Hi everyone . i have this sketch below, where i am to HOLD(and not release) a push button(input) and i have a relay(output) that i want to act as a button (momentarily triggering) . whereas if i HOLD the input, the relay will momentarily be ON, and after 200 milliseconds, it will be off .
and if i Release the button (from holding) , it will also be momentarily ON for 200milliseconds and after that it will be OFF.

however, this is what happens with my sketch below;
whenever i HOLD my input button, the process keeps on repeating , the relay is momentarily ON, then OFF, and then it will trigger again ON and then off, but i am not yet releasing the input button .

what i want is that at the time that i hold the input button (and not yet releasing), it will be momentarily ON, after 200ms it will be OFF and that's it. it must happen for only ONE time the moment i hold it . and the same must be true at the time that i release the input button.

what is the simplest way to do it ?

/////////this is my sketch///////////////////

const int buttonPin = 2;
int relay1 = 1;

void setup() {

pinMode(relay1, OUTPUT);
pinMode(buttonPin, INPUT);
}

void loop(){

int buttonState = digitalRead(buttonPin);

if (buttonState == HIGH) {
digitalWrite(relay1, HIGH);
delay(200);
digitalWrite(relay1, LOW);
}
else {
digitalWrite(relay1, HIGH);
delay(200);
digitalWrite(relay1, LOW);
}
}

If you want the one button to do two things your code needs to detect when the button state CHANGES - not what it IS.

Something like this (not complete and not tested)

byte newButtonState = HIGH;
byte prevButtonState = HIGH;
boolean relayState = false;
unsigned long prevRelayMillis;
unsigned long relayIntervalMillis = 200;

void setup() {
   // usual stuff
}

void loop() {
  readButton();
  operateRelay();
}

void readButton() {
   newButtonState = digitalRead(buttonPin);
   if (newButtonState != prevButtonState) {
      relayState = true;
   }
}

void operateRelay() {
   if (relayState == true) {
       digitalWrite(relayPin, HIGH);
       prevRelayMillis = millis();
       relayState = false;
    }
   if (millis() - prevRelayMillis >= relayIntervalMillis)
      digitalWrite(relayPin, LOW);
  }
}

...R

Edited to correct an error. What is now relayState = true; had (incorrectly) been relayState = 'S';
Error spotted by @UKHeliBob
...R

Robin - I appreciate that your code was incomplete and untested but

boolean relayState = false;

and
relayState = 'S';are not consistent.

are not consistent.

But, annoyingly enough, not wrong.

UKHeliBob:
Robin - I appreciate that your code was incomplete and untested but

boolean relayState = false;

and
relayState = 'S';are not consistent.

Thanks for spotting that

I was trying two approaches and got mixed up. It should be relayState = true;

I will correct the code.

...R

PaulS:

are not consistent.

But, annoyingly enough, not wrong.

That's why I chose my words carefully.

Monitor the time of the initial press, and do not let another press occur until some as yet undefined time interval has passed.
That's the basis of Blink Without Delay.