When: …的时候
的时候 hangs on the END of a clause to mean "when …": 我吃饭的时候 "when I eat". The whole time-clause then comes early in the sentence, before the main action: 我吃饭的时候不看手机 "I don't look at my phone when I eat".
以前 (before) and 以后 (after) work exactly the same way: 睡觉以前 "before going to bed", 下课以后 "after class". English puts "when/before/after" at the START of the clause — Chinese puts these words at the END of it, and the clause itself comes first.
Examples
Common mistakes
Related grammar points
See it in a story
Read this pattern in context: Cleaning the room · Fox Borrows Tiger's Might — free graded stories with tap-to-reveal pinyin and translations.
