If you write in your language and use translate.google.com to have it translated to English, your idea might be clearer to those reading.
This is a basic outline of how I see your sketch... something to start with and pick apart...
byte buttonPin = 2; // tied low with a pulldown resistor
byte relayPin = 13; // connected to signal pin of relay
// relay N.O. = DC motor voltage
// relay COM = DC motor+
// relay N.C. = nothing
void setup() {
pinMode(buttonPin, INPUT); // using pull-down resistor, HIGH when pressed
pinMode(relayPin, OUTPUT); // signal pin to activate relay
}
void loop() {
if (digitalRead(buttonPin)) { // if the button is pressed...
digitalWrite(relayPin, HIGH); // ... turn the relay on...
delay(1000); // ... leave relay on for one second
}
else // when button is NOT pressed (buttonPin is LOW)
digitalWrite(relayPin, LOW); // turn relay off
}
Click here for diagram.json to simulate it on wokwi.com
{
"version": 1,
"author": "Anonymous maker",
"editor": "wokwi",
"parts": [
{ "type": "wokwi-arduino-nano", "id": "nano", "top": 0, "left": 0, "attrs": {} },
{ "type": "wokwi-relay-module", "id": "relay1", "top": 67.4, "left": 172.8, "attrs": {} },
{
"type": "wokwi-pushbutton",
"id": "btn1",
"top": -92.6,
"left": 192.2,
"rotate": 180,
"attrs": { "color": "green" }
},
{
"type": "wokwi-led",
"id": "led1",
"top": -70.8,
"left": 282.2,
"attrs": { "color": "red" }
},
{ "type": "wokwi-vcc", "id": "vcc1", "top": -66.44, "left": 316.8, "attrs": {} },
{
"type": "wokwi-resistor",
"id": "r1",
"top": -44.05,
"left": 96,
"rotate": 270,
"attrs": { "value": "10000" }
}
],
"connections": [
[ "nano:2", "btn1:2.r", "green", [ "v0" ] ],
[ "relay1:VCC", "nano:5V", "red", [ "h0" ] ],
[ "relay1:GND", "nano:GND.1", "black", [ "h0" ] ],
[ "relay1:IN", "nano:13", "green", [ "h0" ] ],
[ "nano:GND.2", "led1:C", "black", [ "v-14.4", "h181.9" ] ],
[ "vcc1:VCC", "relay1:NO", "red", [ "v0" ] ],
[ "relay1:COM", "led1:A", "green", [ "h0" ] ],
[ "nano:GND.2", "r1:1", "black", [ "v0" ] ],
[ "r1:2", "btn1:2.r", "green", [ "v0" ] ],
[ "nano:5V", "btn1:1.r", "red", [ "v14.4", "h57.1", "v-124.8" ] ]
],
"dependencies": {}
}