Apple's new Do Not Disturb function specifically designed to isolate you from your iPhone in a car is welcome, but as far as I'm concerned, it doesn't go far enough. Texting while driving gets all the negative attention, and rightly so because it is so dangerous.
But really anything that distracts a driver from the very cognitively and physically demanding act of driving is a menace. When I was growing up in the 1970s and '80s, we were warned about fiddling with an AM/FM car radio while driving. True, we were warned by people who could drive with one hand while extracting a Marlboro from the pack and lighting it with the other, but the point remained.
A smartphone is the car radio exponentially intensified. In a lot of new cars, the smartphone is competing with various infotainment systems, and if you have a CarPlay or Android Auto enabled vehicle, your phone is embedded in the infotainment system. At the extreme, you have Tesla's massive central touchscreen, which actually allows for web browsing on the go.
You really just have to make a sacrifice for safety. Over the last three years, dealing with the state of the art for infotainment, I've come to the conclusion that you have two options. Number one is turn the phone off. Just do it.
Number two is keep the phone off, pair it with the infotainment system, and stow it in a compartment in the vehicle. Do not take it out. Ever. You won't miss any calls, but you won't be interacting with the most distracting technology ever developed by humans.