is this correct to sttop a bot whchis running

int motor_1_terminal_1 = 5;
int motor_1_terminal_2 = 6;
int motor_2_terminal_1 = 10;
int motor_2_terminal_2 = 11;
i
void setup()
{ Serial.begin(9600);
pinMode(motor_1_terminal_1, OUTPUT);
pinMode(motor_1_terminal_2, OUTPUT);
pinMode(motor_2_terminal_1, OUTPUT);
pinMode(motor_2_terminal_2, OUTPUT);
attachInterrupt(2,stopmotor,CHANGE);
}
void stopmotor()
{
analogWrite(motor_1_terminal_1,0);
analogWrite(motor_1_terminal_2,0);
analogWrite(motor_2_terminal_1,0);
analogWrite(motor_2_terminal_2,0);
}
void loop()
{
analogWrite(motor_1_terminal_1,255);
analogWrite(motor_1_terminal_2,0);
analogWrite(motor_2_terminal_1,255);
analogWrite(motor_2_terminal_2,0);
delay(1000);
analogWrite(motor_1_terminal_1,0);
analogWrite(motor_1_terminal_2,255);
analogWrite(motor_2_terminal_1,0);
analogWrite(motor_2_terminal_2,233);
delay(1000);
}

Impossible to say, since you haven't said anything about the hardware those terminals are connected to.

attachInterrupt(2,stopmotor,CHANGE);

Depending on your board, you may want to check the precise documentation for that function carefully.

Regardless of your board, you will want to start using code tags.

im using arduni due.. i am using ir sensor for it]

nothinghere:
im using arduni due.. i am using ir sensor for it]

Try harder it is still way too vague.