He spaced out while driving and nearly had an accident.
Tips
usage
Northern colloquial form with 儿化 - common in Beijing speech. Without the 儿, 走神 has the same meaning. Literally 'the spirit walks off' - your 神 (mind/spirit) wanders away from what you're doing.