Trying to add servo to my current code

Hello everyone, I have a code that is a water level sensor. That has a lcd display, potentiometer and a water sensor. The lcd displays high, medium, or low water levels. Im trying to add servo to my existing code that when the water level is low servo just reacts to it and when the water level is high the arm on servo stops moving. This is my code. Thank you in advance.

// include the library code:
#include <LiquidCrystal.h>
//initialise the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

int resval = 0; // holds the value
int respin = A5; // sensor pin used

void setup() {

// set up the LCD’s number of columns and rows:
lcd.begin(16, 2);

// Print a message to the LCD.
lcd.print("WATER LEVEL: ");
}

void loop() {
// set the cursor to column 0, line 1
lcd.setCursor(0, 1);

resval = analogRead(respin); //Read data from analog pin and store it to resval variable

if (resval<=100){ lcd.println("Empty "); } else if (resval>100 && resval<=300){ lcd.println("Low "); } else if (resval>300 && resval<=330){ lcd.println("Medium "); } else if (resval>330){
lcd.println("High ");
}
delay(1000);
}

Post your attempt to add the servo code but Auto format it in the IDE first and use code tags when you post the code.

Particularly split this mess into several lines of code to make it more readable

 if (resval<=100){ lcd.println("Empty "); } else if (resval>100 && resval<=300){ lcd.println("Low "); } else if (resval>300 && resval<=330){ lcd.println("Medium "); } else if (resval>330){
    lcd.println("High            ");

That is the struggle I am having everytime i try to include the servo library it messes up the rest of my code

// include the library code:
#include <LiquidCrystal.h>
//initialise the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

int resval = 0; // holds the value
int respin = A5; // sensor pin used

void setup() {

// set up the LCD’s number of columns and rows:
lcd.begin(16, 2);

// Print a message to the LCD.
lcd.print("WATER LEVEL: ");
}

void loop() {
// set the cursor to column 0, line 1
lcd.setCursor(0, 1);

resval = analogRead(respin); //Read data from analog pin and store it to resval variable

if (resval<=100){ lcd.println("Empty ");
}
else if (resval>100 && resval<=300){
lcd.println("Low ");
}
else if (resval>300 && resval<=330{
lcd.println("Medium ");
}
else if (resval>330){
lcd.println("High ");
}
delay(1000);
}

That is the struggle I am having everytime i try to include the servo library it messes up the rest of my code

I see no attempt to use a servo in the code and you chose to ignore the advice to post using code tags.

As before, post your attempt to add the servo code, use code tags when you do (see Read this before posting a programming question) and describe exactly what problems adding the servo code causes

Post the version with the servo code added (IN CODE TAGS) and explain exactly what "messes up the rest of my code" means. Then we can try to explain what's gone wrong.

Steve