Need some help for auto fan control

analogWrite(fan,fan_speed);
this one is fan speed measurement, which will show the speed in serial monior

if (temperature >= 25 )
digitalWrite(fan,HIGH);
else
digitalWrite(fan,LOW);

and the temperature in that one , comes from DHT11 temp and Humidity sensor