I am having a problem with my code on arduino

Chances are that you’re missing a closing face bracket “}” earlier in your code, but it’s impossible to tell from the screenshot that you’ve posted.
I hate to see screenshots of code or error messages posted on the forum as they make it impossible for us to copy your code and drop it into the IDE and test it ourselves.

Obviously when you do paste code it needs to have triple backticks at the beginning and end of the code. Triple backticks look like this:
```

My advice would be to go through your code and move the opening face brackets “{” on to a line of their own, and use the tab key to indent your code consistently. That way, it’s very easy to scan up and down our sections of code and spot the mismatched face brackets, like this…

void alarmState()
{
  if switch2Bounce.update())
  {
    if (switch2Bounce.fell())
    {
      alarm = !alarm;
      Serial.print("Alarm=");
      Serial.print(alarm);
    }
  }
}

Pete.