Adding Bluetooth on pre-written codes HELP!

Hello I am very new to the programming world and found this code online, it is a coin operated machine where a user can insert a coin and enable a relay switch for a specific amount of time, eventually it will turn off after the timer goes down
I am wondering if I can add Bluetooth HC05 to this code and create an application from MIT app inventor problem is I can’t modify it because I didn’t understand the code
can someone help me understand the codes? and add Bluetooth on it?

#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>

#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))    
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))    
#define seconds() (millis()/1000)

LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);

const int coinPin = 2;
const int button1 = 8, button2 = A0, button3 = 3;
const int relay1 = 10, relay2 = 11, relay3 = 12;
const int button1pushed = 0b00110000;
const int button2pushed = 0b00101000;
const int button3pushed = 0b00011000;
volatile long unsigned eventTime;
volatile long unsigned previousEventTime;
volatile long unsigned timeSinceLastEvent;
volatile byte portDstatus;
volatile byte eventFlag0, eventFlag1, eventFlag2, eventFlag3;
long timeSpent = 0, startTime = 0, coinTimeVal = 10000;
long timeLeft = 0;
int event, pulse = 0;
bool event1running = false, event2running = false, event3running =false;

void setup(){
  
  Serial.begin(9600);
  pinMode(button1, INPUT_PULLUP);
  digitalWrite(button1, HIGH);
  pinMode(button2, INPUT_PULLUP);
  digitalWrite(button2, HIGH);
  pinMode(button3, INPUT_PULLUP);
  digitalWrite(button3, HIGH);
  pinMode(relay1, OUTPUT);
  digitalWrite(relay1, HIGH);
  pinMode(relay2, OUTPUT);
  digitalWrite(relay2, HIGH);
  pinMode(relay3, OUTPUT);
  digitalWrite(relay3, HIGH);
  
  cli();
  PCICR |= 0b00000011;
  PCMSK0 |= 0b00000001;    
  PCMSK1 |= 0b00000001;
  sei();
  attachInterrupt(digitalPinToInterrupt(button3), button3event, RISING);
  lcd.begin(16, 2);
  attachInterrupt(digitalPinToInterrupt(coinPin), coinInterrupt, RISING);
}


void loop()
{
  
  if (timeLeft <= 0){
    if (timeLeft < 0){timeLeft=0;}
    welcomeInsertCoinMessage();
    if (event1running){
      switchRelay(relay1, event1running);
      event1running = !event1running;  
    }
    else if (event2running){
      switchRelay(relay2, event2running);
      event2running = !event2running;  
    }
    else if (event3running){
      switchRelay(relay3, event3running);
      event3running = !event3running;  
    }
  }
  else {
    printTime(timeLeft);
    Serial.println(int(timeLeft/1000));
    if (eventFlag1 == 1 && (eventTime-previousEventTime>100)){
      previousEventTime=eventTime;
      switchRelay(relay1, event1running);
      event1running = !event1running;
      Serial.println(event1running);
      if (event1running){
        startTime = millis();
        printStatus("Wash...");  
      }else{
        printStatus("Washing paused"); 
      }
      eventFlag1 = 0;
    }
    else if (eventFlag2 == 1 && (eventTime-previousEventTime>100)){
      previousEventTime=eventTime;
      switchRelay(relay2, event2running);
      event2running = !event2running;
      if (event2running){
        startTime = millis();
        printStatus("Soap...");  
      }else{
        printStatus("Soap paused"); 
      }
      eventFlag2 = 0;
    }
    else if (eventFlag3 == 1 && (eventTime-previousEventTime>100)){
      previousEventTime=eventTime;
      switchRelay(relay3, event3running);
      event3running = !event3running;
      if (event3running){
        startTime = millis();
        printStatus("Dry...");  
      }else{
        printStatus("Dry paused"); 
      }
      eventFlag3 = 0;
    }
    if (event1running || event2running || event3running){
      timeLeft -= (millis() - startTime);
      startTime = millis();
    }
  }delay(100);
}


ISR (PCINT0_vect){
  eventTime=millis();
  eventFlag1=1;
}

ISR (PCINT1_vect){
  eventTime=millis();
  eventFlag2=1;
}

void button3event(){
  eventTime=millis();
  eventFlag3=1;
}
void coinInterrupt(){
  timeLeft += coinTimeVal;
}

void welcomeInsertCoinMessage(){
    lcd.clear();
    lcd.setCursor(4, 0);
    lcd.print("WELCOME!");
    lcd.setCursor(0, 1);
    lcd.print(" ->Insert Coin<-");
    
  }

void printTime(long timer){
    long mins, secs, real_sec;
    String t;
    lcd.setCursor(0, 0);
    lcd.print("               ");
    real_sec = timer/1000;
    mins = real_sec/60;
    secs = real_sec%60;
    Serial.println(secs, mins);
    if (mins > 9 and secs >9){
      t = String("Time  ") + String(mins) + String(":") + String(secs);
    }else if (mins > 9 and secs < 10){
      t = String("Time  ") + String(mins) + String(":") + String(secs);
    }else if (mins < 10 and secs > 9){
      t = String("Time  ") + String("0") + String(mins) + String(":") + String(secs);
    }else{
      t = String("Time  ") + String("0") + String(mins) + String(":") + String("0") + String(secs);
    }
    lcd.setCursor(0, 0);
    lcd.print(t);
}

void printStatus(String s){
  lcd.setCursor(0, 1);
  lcd.print("               ");
  lcd.setCursor(0, 1);
  lcd.print(s);
}
void switchRelay(int relaynum, bool onOff){
  digitalWrite(relaynum, onOff);
  }

HizonPastor:
add Bluetooth on it?

#e, event3running =false;

void setup(){
 
 Serial.begin(9600);
............
   Serial.println(secs, mins);

If the code you have works with the serial monitor, you don't need to add any code to have it work with Bluetooth.. Just connect Bluetooth to serial RxTx and you are off to the races.

You might find the following background notes useful.