"开小差 (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