The resistor divider type of circuit as you proposed before actually requires the Arduino and the car to share grounds.
The optocoupler circuit that I posted is meant for an Arduino that's by and large separated from the car battery - e.g. via its own battery, or via a car power supply that produces a stable 5V from the unstable 12V battery supply. This separation makes it much safer, especially as you're keeping the car ground (the chassis usually) away from the Arduino.