The "passé composé" is refering to an action in the past that is definatly over when you speak of it and not lasting.
For instance:
"J'ai mangé une pizza hier soir."
-->You ate the pizza yesterday evening but this constatation is no more valid and is limited in time, only for the time of the meal.
The "Imparfait" is refering to a lasting action in the past, and thus that is finished at the moment you speak of it.
For instance:
"Je nageais dans la mer."
-->So you were swimming in the sea, which is a past event but this action lasted during the time you did it actually.
The main thing to keep in mind is that the "passé composé" focuses on the past notion whereas "imparfait" focuses on the notion of duration in the past.
If you are wondering which verb you gotta use, just use the time concordance. Usually, when the simple past is used in a sentence, it usually referes to "passé composé" in french and same for past continuous to "imparfait".