iOS 11 has a useful Do Not Disturb feature that you should really use when you’re behind the wheel. The operating system can “sense” when you might be driving and help keep you from being distracted by calls, texts, and notifications.
Go to Settings › Do Not Disturb, then tap Activate under the Do Not Disturb While Driving heading. Or add it to Control Center for quicker access.