开小差(kāi xiǎo chāi) slope away; daydreaming
Usage:

“开小差” 原指军人脱离队伍私自逃跑,现在常用来比喻思想不集中,做事不专心。
“开小差” original means a solider deserted from the army. Now it indicates who cannot concentrate on doing something.

Sentences:

1、他因为这件事夜里睡不好, 白天上课时思想开小差。
Tā yīnwèi zhè jiàn shìyèlǐ shuì bù hǎo, báitiān shàngkè shí sīxiǎng kāi xiǎo chāi.
He slept badly at night because of this event and couldn't concentrate in class at daytime.

2、Gōngzuò shí sīxiǎng bùnéng kāi xiǎo chāi.
工作时思想不能开小差。
Don't daydream while working.

原文链接