IR led and sensor code problem

Hi, I am trying to emit a frequency of 38 kHz from my 2 IR leds (not a TV remote). Then I have 2 sensors which will pick up the waves and then spin motors accordingly. However, when I put my hand in front of a IR led to tell the sensor that there is an object in front of it, the sensor does not pick up the signal. The motors just continue spinning randomly and do things that I do not intend for them to do (ie. if I want it to turn clockwise (cw) it turns counterclockwise (ccw)). Is there anything wrong with my code and how I am emitting the two frequencies? I also am trying to keep track of the states of the two sensors but nothing is printed out in the serial monitor.
This is the first time I have used arduino and this is for a school project. Please tell me if there is any more information you all need to help me.
Thanks for your time.

#include<IRremote.h>;

int irRight = 6; //right ir led
int irLeft = 5;  //left ir led
int irReceiverRight = 7;  //right receiver
int irReceiverLeft = 4;  //left receiver

void setup(){
  Serial.begin (9600);
  pinMode (irRight, OUTPUT);
  digitalWrite(irRight, HIGH);
  pinMode (irLeft, OUTPUT);
  digitalWrite (irLeft, HIGH);
  pinMode (irReceiverRight, INPUT);
  digitalWrite (irReceiverRight, LOW);
  pinMode (irReceiverRight, INPUT);
  digitalWrite (irReceiverLeft, LOW);
  pinMode (12, OUTPUT);  //motor 1
  pinMode (9, OUTPUT);
  pinMode (13, OUTPUT);  //motor 2
  pinMode (8, OUTPUT);
}

void loop(){
  int receiverRightState = digitalRead (irReceiverRight);
  int receiverLeftState = digitalRead (irReceiverLeft);
  
  
  if((digitalRead (irReceiverRight) == LOW) && (digitalRead (irReceiverLeft) == LOW)) //turns the motor cw if both sensors receive no signal
   driveForward();
  else if(digitalRead (irReceiverRight) == HIGH && digitalRead (irReceiverLeft) == LOW) //stops motor 1 and turns it ccw, the second motor turns cw if the right sensor picks up a signal
  {
    stopMotor();    
    driveBackward(); 
    stopMotor();
    turnLeft();
  }else if (digitalRead (irReceiverLeft) == HIGH && digitalRead (irReceiverRight))  //stops motor 1 and turns it cw, the second motor turns ccw if the left sensor picks up a signal
  {
    stopMotor();
    driveBackward();
    stopMotor();
    turnRight();
  }else //it both sensors pick up a signal, motor 1 stops and turns ccw
  {
    stopMotor();
    driveBackward();
    stopMotor();
    for (int x = 0; x <= 3; x++)
      turnRight();
  }
  
  Serial.println(receiverRightState + "" + receiverLeftState);
}

void driveForward()
{
  digitalWrite (12, HIGH);
  digitalWrite (9, LOW);
  analogWrite (3, 255);
  
  delay (1000);
}

void driveBackward()
{
  digitalWrite (12, LOW);
  digitalWrite (9, LOW);
  analogWrite (3, 255);
  
  delay (1000);
}

void stopMotor()
{
  digitalWrite (12, HIGH);
  digitalWrite (9, HIGH);
  analogWrite (3, 0);
  
  delay (1000);
}

void turnLeft()
{
  digitalWrite (13, HIGH);
  digitalWrite (8, LOW);
  analogWrite (11, 200);
  
  delay (500);
  
  digitalWrite (8, HIGH);
  
  delay (500);
  
  driveForward();
  
  digitalWrite (13, LOW);
  digitalWrite (9, LOW);
  analogWrite (11, 200);
  
  delay (500);
  
  digitalWrite (8, HIGH);
}

void turnRight()
{
  digitalWrite (13, LOW);
  digitalWrite (8, LOW);
  analogWrite (11, 200);
  
  delay (500);
  
  digitalWrite (8, HIGH);
  
  delay (500);
  
  driveForward();
  
  digitalWrite (13, HIGH);
  digitalWrite (9, LOW);
  analogWrite (11, 200);
  
  delay (500);
  
  digitalWrite (8, HIGH);
}

Lots of delay ( ); used in there.

aac353: I also am trying to keep track of the states of the two sensors but nothing is printed out in the serial monitor.

  Serial.println(receiverRightState + "" + receiverLeftState);

Try instead:

Serial.print(receiverRightState);
Serial.print(" ");
Serial.println(receiverLeftState);

I am trying to emit a frequency of 38 kHz from my 2 IR leds

There is no code that does this, is this generated by hardware?

What sort of IR receiver are you using? Most will not cope with a continuous pulse train. The only one I know that will is the TSOP4038.