connecting Arduino to IR obstacle sensors

Hi,

I was looking at some robots on youTube that are autonomous and are using IR sensors to move between obstacles.

I was wondering if there is a simple way to connect and use IR sensors with the arduino (is there a built-in lib in Arduino IDE for that) ?

Many thanks, ;)