counting rotations of wheels using IR sensor

Hello guy's I am new here. Currently I am doing my last year project. I am working on a agriculture vehicle. I want to move my vehicle forward and backward. I want to count the rotations of wheel by using IR sensor and then stop the motor after say ten rotations. But I really don't know the program for counting the pulses. Plz help me. M really stuck here.

Please provide a drawing of how your hardware setup looks like and how you connected the sensor to the Arduino.