What is wrong with my code? School project

Hi all, doing a school project, making an Arduino based fire fighting robot. I am using the following code:

#include <Servo.h>
Servo myservo;

int pos = 0;
boolean fire = false;
#define Forward_S 8 //forward sensor
#define LM1 2 // left motor
#define LM2 3 // left motor
#define RM1 4 // right motor
#define RM2 5 // right motor
#define pump 6

void setup()
{
pinMode(Forward_S, INPUT);
pinMode(LM1, OUTPUT);
pinMode(LM2, OUTPUT);
pinMode(RM1, OUTPUT);
pinMode(RM2, OUTPUT);
pinMode(pump, OUTPUT);

}

void put_off_fire()
{
delay (500);

digitalWrite(LM1, HIGH);
digitalWrite(LM2, HIGH);
digitalWrite(RM1, HIGH);
digitalWrite(RM2, HIGH);

digitalWrite(pump, HIGH);
delay(500);
}
digitalWrite(pump,LOW);
fire=false;
}

void loop()

{
//Do not move the robot
digitalWrite(LM1, HIGH);
digitalWrite(LM2, HIGH);
digitalWrite(RM1, HIGH);
digitalWrite(RM2, HIGH);
}

else if (digitalRead(Forward_S) ==0) //If Fire is straight ahead
{
//Move the robot forward
digitalWrite(LM1, HIGH);
digitalWrite(LM2, LOW);
digitalWrite(RM1, HIGH);
digitalWrite(RM2, LOW);
fire = true;
}

delay(300); //Slow down the speed of robot

while (fire == true)
{
put_off_fire();
}
}

The code shows the following error(s):

arduino_based_fire_fighting_robot:36:15: error: expected constructor, destructor, or type conversion before '(' token
digitalWrite(pump,LOW);
^
arduino_based_fire_fighting_robot:37:3: error: 'fire' does not name a type
fire=false;
^~~~
arduino_based_fire_fighting_robot:38:1: error: expected declaration before '}' token
}
^
exit status 1
expected constructor, destructor, or type conversion before '(' token

Newbie to Arduino, found the code off a tutorial. Any help would be greatly appreciated. Cheers

Please correct your post above and add code tags around your code:
[code]`` [color=blue]// your code is here[/color] ``[/code].

It should look like this:// your code is here
(Also press ctrl-T (PC) or cmd-T (Mac) in the IDE before copying to indent your code properly)


found the code off a tutorial

you probably did not copy well....

if you look carefully at the code, there is a closing bracket that is misplaced in put_off_fire() and look at your loop(), there are also weird stuff going on (an else with no if, a closing bracket coming in too early, ...)

void put_off_fire()
{
    delay (500);
 
    digitalWrite(LM1, HIGH);
    digitalWrite(LM2, HIGH);
    digitalWrite(RM1, HIGH);
    digitalWrite(RM2, HIGH);
   
   digitalWrite(pump, HIGH);
   delay(500);
  }    <<<<<<<<<<<<<<--------------- extra, remove this
  digitalWrite(pump,LOW);
  fire=false;
}