We already know that the past simple in Spanish expresses an action completed in the past. This action is located at a specific moment in an ended time. For this reason, it is usually accompanied by temporal expressions such as: ayer, el año pasado, la semana pasada, en 2010, hace cinco días…
El lunes pasado visité a mis amigos en España.
It is widely used in narratives to order actions:
El detective entró en la casa. Lo primero que vio, fue el cuerpo de la víctima. Se agachó, sacó sus guantes y se los puso.
Regarding the contrast with other past tenses, we can say that the difference with the present perfect compound tense is in the time in which the action takes place. If this time is finished, we use the simple tense, if it is open, we use the compound one:
Hoy no he visto a mi profesor, pero ayer lo vi en el supermercado.
On the other hand, the contrast with the imperfect preterite is in the termination of the action. The perfect tense indicates that the action began and ended, but the imperfect expresses an action in progress that can be interrupted by another.
Mi hermano estaba leyendo un libro cuando yo lo llamé.
Likewise, the imperfect expresses habits in the past, as opposed to the perfect, which indicates a punctual action.
En Madrid, yo siempre iba a la escuela, pero un día me puse enfermo y no fui.