PID Control : Arduino Uno + LM35 + CPU Fan

Hello everyone! i´m building an arduino project that consists of a computer fan controlling the temperature of a LM35 sensor, but i am stuck doing the PID control.
‪#‎include‬ <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,20,4);
int tempPin = A1; // the output pin of LM35
int fan = 9; // the pin where fan is
int temp;
int tempMin = 22; // the temperature to start the fan
int tempMax = 50; // the maximum temperature when fan is at 100%
int fanSpeed;
int fanLCD;
void setup() {
pinMode(fan, OUTPUT);
pinMode(tempPin, INPUT);
lcd.init();
lcd.init();
lcd.backlight();
lcd.begin(16,2);
}
void loop() {
temp = readTemp(); // get the temperature
if(temp < tempMin) { // if temp is lower than minimum temp
fanSpeed = 0; // fan is not spinning
digitalWrite(fan, LOW);
}
if((temp >= tempMin) && (temp <= tempMax)) { // if temperature is higher than minimum temp
fanSpeed = map(temp, tempMin, tempMax, 32, 255); // the actual speed of fan
fanLCD = map(temp, tempMin, tempMax, 0, 100); // speed of fan to display on LCD
analogWrite(fan, fanSpeed); // spin the fan at the fanSpeed speed
}
lcd.print("TEMP: ");
lcd.print(temp); // display the temperature
lcd.print("C ");
lcd.setCursor(0,1); // move cursor to next line
lcd.print("FANS: ");
lcd.print(fanLCD); // display the fan speed
lcd.print("%");
delay(200);
lcd.clear();
}
int readTemp() { // get the temperature and convert it to celsius
temp = analogRead(tempPin);
return temp * 0.48828125;
}
What i am supposed to do to implement the PID control? Thanks !

What i am supposed to do to implement the PID control?

Decide just exactly what you want to control, and with what information.

Then, use the PID library.

i want to control the temperature using the fan. In my system i have a lamp that will increase the temperature of the system, when reaches a certain level of temperature, the fan starts to work.

So, what is the problem? There is a PID library, with examples. What more do you need?