Trying to differentiate between the use of these two tenses can often prove challenging for Spanish students. However, there are some key points that may help you when trying to decide which tense to use.
The Imperfect is used:
1) To state an action in the past which is habitual.
E.g. Iba al supermercado todos los viernes.
2) To describe mental states in the past.
E.g. No sabía lo que había pasado.
3) To provide descriptions in the past. For example, what a person was like or what th weather was like.
E.g. Mi bisabuela era bastante baja.
4) To present an action in the past which was ongoing or in progress.
E.g. Yo trabajaba mucho para conseguir lo que quería.
The Preterite is used:
1) To state an action in the past which has been completed.
E.g. Comí el helado.
2) To present a set of past actions in sequence.
E.g. Fui al cine, visité a mi amigo y luego hablé a mi madre.
3) To demonstrate the beginning or the end of an action/ state, or else present a change of action/ state.
E.g. Me puse rojo.
4) To indicate that an action has interrupted a previous action that was in progress (which is normally presented in the imperfect).
E.g. Mientras su hermana trabajaba, fue a la piscina.