what is the difference between when and while ?how is their usage?
Generally speaking, we use "when" to show that something happens at a specific time and at the same time that something else is in progress. This could be in the present, past, or future.
They were drinking coffee when the phone rang.
She'll be leaving when we arrive. We have to get there by 9 if we want to talk to her.
Generally speaking, we use "while" to show that two things happen at the same time. Oftentimes, "while" is used to show that an action in progress is interrupted by another action. There are many possibilities. Here are a few. You could try writing some sentences of your own. It's easier to think of examples using the past tense, but it's possible to use the present and the future.
While they were drinking coffee the phone rang.
While they were listening to the news and drinking coffee, the phone rang.
She was making a salad while he was making some rice.