English grammer tenses are used to express at what point in time an action took place. When talking about a continuous action, that is still taking place and began at a particular time in the past, you will use past continuous tense. It is important to understand how verbs are used together to properly express your ideas and get your point across in a way that is properly executed and understandable to the reader.
In most cases when using past continuous tense, also known as past progressive tense, you are going to be using the combination of a helping "to be" verb, in the past tense, along with the present participle of the verb, with the -ing ending. Using "WAS/WERE," along with the present participle in your sentence, as in the example; "I was cooking dinner, when the phone rang," would be the proper way to write in past continuous tense. In comparison, a past perfect progressive tense is used to express a continuous action that has been completed at some point in the past. The past perfect progressive tense is formed using "HAD" plus "BEEN," along with the present participle of the verb with the -ing ending. Such as,"I had been gardening before it started to rain."
There are variances to the past continuous tense form that can be used depending on how many actions are taking place and what type of interferences happened during those actions. You can use past continuous when talking about a longer action in the past being interrupted by a shorter action, such as; "I was reading a book when the doorbell rang". An action can also be interrupted by a specific time; " This morning at 5 AM, it was raining." Finally, this tense can be used when two actions are happening simultaneously, at the same time in the past. It is important to emphasize that both of the actions are happening at the same time, as if parallel. "I was eating, while John was studying."
When using past continuous tense you will be emphasizing that the activity is a continuing process. If the activity happened in the past and has already come to an end, then you would use past perfect progressive tense. It is important to use the right English grammer tense, and use it properly to get your point across in a clear and concise manner.