Any distance sensor with drivers supporting Linux on ARM should work. A quick Google search returns dozens of forum threads by people asking about recommendations for distance sensors for various use cases on Raspberry Pi. Most distance sensors for embedded devices are ultrasonic which will not work for this application. You’re probably going to need to use a LIDAR for this which might be a challenge to wire up effectively as they can be power hungry.
For the software side you’ll have to create a formula specific to your vehicle to calculate stopping distance as it varies wildly based on the car and road conditions. Then you’d just run it in a loop exposing the output in a readable way.
You’re probably not going to see a ton of assistance with this. It sounds like a pretty big project and more and more cars have this functionality built in these days.