"開小差 (Kāixiǎochāi)" literally means "to take a small deviation." The idiom originally referred to soldiers who would leave their post or duties without permission. Over time, it came to mean someone who is mentally wandering or not paying attention, as if they've left their responsibilities behind to daydream.
For example:
Kāi huì de shí hòu nǐ bù yào kāi xiǎo chāi, yào zhuān zhù tīng jiǎng.
開會的時候你不要開小差,要專注聽講。
Don’t daydream during the meeting; pay attention to the presentation.
Source:eChineseLearning