The imperfect tense is the tense we use when we talk about an ongoing action in the past. It is therefore what we use when we talk about what we used to do when we were younger (we did it more than once, it was a habit). An example! - Eng: When I was young, I used to eat lots of chocolate. Fr: Quand j'étais jeune, je mangeais beaucoup de chocolat.
We can see here that it happened more than once, hence why we have used the imperfect tense. Remember that the imperfect is very easy to form in regular verbs. (We can revise this if we need to!)
In contrast, if you did something just the once at a set time in the past, we would then need to use the perfect tense, or as they call it in text books, the passé composé. An example would be: Eng: Yesterday, I ate chocolate. (It only happened once!) Fr: Hier, j'ai mangé du chocolat. Hopefully this explanation makes it clear when you need to use the imperfect tense!