Making a sketch into a library

Hello everyone

I would like to make this sketch into a library

/*
Arduino Water flow meter
YF- S201 Hall Effect Water Flow Sensor
Water Flow Sensor output processed to read in litres/hour
*/
volatile int flow_frequency; // Measures flow sensor pulses
unsigned int l_hour; // Calculated litres/hour
unsigned char flowsensor = 2; // Sensor Input
unsigned long currentTime;
unsigned long cloopTime;
void flow () // Interrupt function
{
   flow_frequency++;
}
void setup()
{
   pinMode(flowsensor, INPUT);
   digitalWrite(flowsensor, HIGH); // Optional Internal Pull-Up
   Serial.begin(9600);
   attachInterrupt(0, flow, RISING); // Setup Interrupt
   sei(); // Enable interrupts
   currentTime = millis();
   cloopTime = currentTime;
}
void loop ()
{
   currentTime = millis();
   // Every second, calculate and print litres/hour
   if(currentTime >= (cloopTime + 1000))
   {
      cloopTime = currentTime; // Updates cloopTime
      // Pulse frequency (Hz) = 7.5Q, Q is flow rate in L/min.
      l_hour = (flow_frequency * 60 / 7.5); // (Pulse frequency x 60 min) / 7.5Q = flowrate in L/hour
      flow_frequency = 0; // Reset Counter
      Serial.print(l_hour, DEC); // Print litres/hour
      Serial.println(" L/hour");
   }
}

So I can incorporate it into the Buildlog Laser Cutter Marlin Master file. (I have not included that file and the arduino sketch as it is quite large) to run a Co2 Laser cutter to sense cooling water flow.

I have read the Library tutorial about converting a sketch into a library but what i dont understand is do I do this in arduino or a wordpad document like all the files that are in the Buildlog files for running a laser are done

You need to read up on this a bit more , google will give you some good info.
Libraries aren’t really about converting sketches.

Most bits are written in the IDE.

thanks for the reply

as the usual arduino dummy that i am i think i have found the answer after posting this question but if i need more help i will post again to this
Tahnks James