When clauses
When clause
When(ever) I drink coffee,
Result clause
I can't sleep.
Result clause
I can't sleep
When clause
when(ever) I drink coffee.
These sentences talk about things tat are usually true: When X happens, Y is the result. 
The present tense is used in the when clause and the result clause.
The result clause can come first or second in a sentence. When it comes first, there is no comma between the result clause and the when clause.