The perfect tense is used to for completed actions in the past. For example, le semaine dernier je suis allé en France would translate to last week I went to France. The imperfect is used for incomplete action. For example, j'allais en France would translate to I was going to France.
The imperfect can also be used to describe something that happened regularly in the past, a habitual event. So the imperfect would be used to translate when I was younger I used to pay football - Quand j'étais petit je jouais au foot.
The imperfect can be used to set the scene in the past, so describing the weather on a day in the past would be formed in the imperfect tense: hier il faisait chaud.
Finally, there are situations in which the perfect tense and imperfect tense are used together in the same sentence. For example, I was doing my homework when the telephone rang. 'I was doing my homework' would be translated in the imperfect tense as this is an incomplete action. 'The telephone rang' would be translated in the perfect tense as this is a complete event in the past.
So the sentence as a whole would translate into French to be:
Je faisais mes devoirs quand le téléphone a sonné.