IR-08H Sensor, Easy Code, Simple Question?

Hello, I am quite new to the Arduino way of things as well as coding.
I want to use an IR-08H sensor to detect when something is very close to it, and to signal as so by turning off its LED. I'm not sure if this code I'm using is correct, but if it is, what would I put in the loop here: "if(read = 1) digitalWrite(pinMode,LOW)" instead of 'read'.

/* Turns LED off when an object is close.
*/
// ------ VARIABLES ------

int count;

// ------ SETUP -------

void setup() {
 
 Serial.begin (9600);
 pinMode (9, INPUT); // Sensor output
}

// ------ FUNCTIONS ------

void read() {
  Serial.print ("Sensor: ");
 Serial.println (digitalRead(9)); // Print the sensor output; 1 if nothing is detected, 0 if something is.
 delay (500); // Wait half a second.
}

// ------ LOOP ------

void loop() {
if(read = 1) digitalWrite(pinMode,HIGH) // If the above result is 1, the light will stay on. 
}
else {
  digitalWrite(pinMode,LOW) // If the above result is not 1 (0), the light will turn off.
}

Other items of information:
I'm using Arduino Uno. I have a Prototype Shield v.5 on top, with a breadboard connected. I have the Ir-08H's pins correctly wired; the output to pin 9, the vcc to 5V, and the ground is grounded.

Please correct me if I'm wrong

MirrorBreak:
Hello, I am quite new to the Arduino way of things as well as coding.
I want to use an IR-08H sensor to detect when something is very close to it, and to signal as so by turning off its LED. I'm not sure if this code I'm using is correct, but if it is, what would I put in the loop here: "if(read = 1) digitalWrite(pinMode,LOW)" instead of 'read'.

/* Turns LED off when an object is close.

*/
// ------ VARIABLES ------

int count;

// ------ SETUP -------

void setup() {

Serial.begin (9600);
pinMode (9, INPUT); // Sensor output
}

// ------ FUNCTIONS ------

void read() {
  Serial.print ("Sensor: ");
Serial.println (digitalRead(9)); // Print the sensor output; 1 if nothing is detected, 0 if something is.
delay (500); // Wait half a second.
}

// ------ LOOP ------

void loop() {
if(read = 1) digitalWrite(pinMode,HIGH) // If the above result is 1, the light will stay on.
}
else {
  digitalWrite(pinMode,LOW) // If the above result is not 1 (0), the light will turn off.
}




Other items of information:
I'm using Arduino Uno. I have a Prototype Shield v.5 on top, with a breadboard connected. I have the Ir-08H's pins correctly wired; the output to pin 9, the vcc to 5V, and the ground is grounded. 

Please correct me if I'm wrong

If you're a newb to coding then no, that's not easy code for you as the errors attest.

if (read() == 1) 
{
  digitalWrite(mysteryPin,HIGH) // If the above result is 1, the light will stay on. 
}
else {
  digitalWrite(mysteryPin,LOW) // If the above result is not 1 (0), the light will turn off.
}

And mysteryPin needs to be pinMode(mysteryPin,OUTPUT) before you can write to it.