I made a line-follower robot called Movit (commercially produced kit several years back).
It followed a dark line on the floor. It could be drawn on a large paper sheet. Or it could be the joint between floorboards.
The sensors were two light detectors close to the floor. I found it's crucial to get the sensor head right up against the line.
One sensor would not be sufficient. Two are needed for directional sensing.
It had two motors. One for each drive wheel. These were alternately switched full on and full off rapidly. Each drove four plastic gears to reduce speed.
The robot shimmied from side to side rapidly, as it followed the line. It moved a few inches per second.
The onboard circuitry must respond quickly. It has to turn the motors on and off quickly. If there was any delay then the robot would depart from the line.
The drive circuitry was simple. It didn't use PWM.
It's possible that PWM could work well. THen both right and left sides could drive at the same time. This will be complicated to get it to work.