Both the perfect (passé composé) and imperfect (imparfait) are past tenses. However, which tense you use depends on the "type" of past action you are trying to convey. Below are the differences, which will help you choose between the two tenses:
Passé composé: Complete action e.g. on a perdu le chat Specific, countable action New, irregular or important action More impactful, for emphasis e.g. elle a gagné le loto
Imparfait: Incomplete action e.g. je travaillais tous les soirs Continuous, uncountable action Regular, common action More descriptive e.g. j'étais ébloui