I need some help programming the arduino

I have a MQ9 sensor, I want the Fan to run when the sensor detects 30~400 PPM of CO. And to turn the LED on if it goes above 400PPM.

Thanks in advance.

I don't have an MQ9 sensor but did it come with a link to code and wiring instructions? You need to be able to run a test sketch just to confirm that the sensor does work. Doing that is your step 1.

What fan? A fan that you switch on the power and it runs or one that will require a motor driver and code to run? If it's the former you can use a cheap relay to switch on and off with proviso that you don't switch too fast/often.

You can make a led turn on and off? Maybe add a buzzer given the nature of carbon monoxide?

Here is the MQ-9 datasheet Link on the playground for MQ9 sensor http://playground.arduino.cc/Main/MQGasSensors

To detect Carbon Monoxide CO you need low temperature (heated need to be 1.5V at about 50mA). The output is an analog signal and can be read with an analog input of the Arduino.