IR module sensor query for Line Follwer Robot
The sensor you have used is fine. There is a potentiometer on the sensor PCB that is used for the range. For the line following robot you would want the range small, between 1-4cm. However, for the obstacle avoidance robot you would want to set this for a much larger range, say 10-45cm.

To make an effective line following robot you need at least 2-3 sensors.

Here is one using 2 LEDs either side of the line:


And here is a 3 sensor robot:

Notice that one LED stays on the line.

And finally a 5 sensor robot:


The following websites have good step by step guides where they explain the various techniques:


https://www.learnrobotics.org/blog/how-to-build-a-mobile-robot-using-arduino-part-4/
https://circuitdigest.com/microcontroller-projects/line-follower-robot-using-arduino 
http://www.robotc.net/wikiarchive/Tutorials/Arduino_Projects/Mobile_Robotics/VEX/Using_the_line_tracker_to_follow_a_line


When I made my line following robot I used 2 of the following sensor:


These sensors were great as they pointed in towards each other, making a focal point. You can do this to your sensor by bending the LEDs slightly towards each other.