Usage of while and when

I want to use the right tens with these words. I realy get confused to choose between them in a grammar sheet.would you help me, plz?

These conjunctions do not have fixed tenses, they could be used with several different tenses. Perhaps you could provide an example.

When is a fixed point in time. It is used to define a fixed point such as “when we arrived, when we arrive”. While can be thought of as meaning “during”.

Look at this …

While she was cooking (during this process), the doorbell rang (this fixed point perception happened)

Let’s reverse it …

When the doorbell rang (now a fixed point in time), she was cooking.

Both sentences can also be reversed …

The doorbell rang, while she was cooking (during this process)
She was cooking, when the doorbell rang (now a fixed point in time)

Although not a complete explanation, this should give you a start on the theme and help you later to greater understanding of “when and while”