What I think you're looking for is Adaptive Cruise Control whereby if the vehicle ahead slows down or someone cuts into your lane, the car eases off the accelerator or uses the brakes to slow down and keep an appropriate distance.
You also set the speed (adapts your speed) to maintain a preset distance between your vehicle and the one in front.
Generally these are a factory installed device.
If your vehicle has cruise control , then it may be possible to add the forward facing radar, firmware etc.
You need to Google