LCD shows wrong value from MQ-135 sensor and the txt is stuck on screen
You made a mistake in the line:
else(co2lvl&lt;=1600);

Because of the semicolon (;) it will not do anything for that condition. But instead the following lines will be executed always.
The following is a slight refactoring making your code more clear, removing also duplicated code:
#include &lt;LiquidCrystal.h&gt;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
#define sensor A0
int gas, co2lvl;

void setup()
{
  pinMode(sensor,INPUT);
  Serial.begin(9600);
  lcd.begin(20,4);
  lcd.clear();
}

void loop()
{
  co2lvl=gas-255;
  co2lvl=map(co2lvl, 0,1024,400,5000);
  Serial.print(co2lvl);
  Serial.print(&quot;ppm&quot;);
  Serial.println();
  delay(200);
 
  lcd.setCursor(0,0); 
  lcd.print(&quot;CO2 PRESENT IN THE AIR&quot;);
  lcd.setCursor(0,1);  
  lcd.print(analogRead(co2lvl)); 

  if      (co2lvl &lt;=  300) { show(6, &quot;EXCELLENT&quot;); }
  else if (co2lvl &lt;=  700) { show(4, &quot;GOOD&quot;     ); }
  else if (co2lvl &lt;=  900) { show(5, &quot;FAIR&quot;     ); }
  else if (co2lvl &lt;= 1100) { show(5, &quot;MEDIOCRE&quot; ); }
  else if (co2lvl &lt;= 1600) { show(5, &quot;BAD&quot;      ); }
}

void show(int position, char* text)
{
  lcd.setCursor(position, 1);
  lcd.print(text);
}