Both the present perfect and the imperfect are verbs that belong to the indicative mood category. The indicative mood is used to indicate facts which means that both the present perfect and the imperfect are used to “state” facts.
The imperfect is a simple verb (simple meaning it ALWAYS AND ONLY has ONE verb). The imperfect is used to describe actions that happened REPEATEDLY in the past, for example " I ate pasta with my grandparents, every day"-> "tutti i giorni, mangiavo la pasta con i miei nonni".
The present perfect is a compound verb (compound meaning it is ALWAYS made up of TWO verbs). The verbs are essere and avere (to be and to have) and a past participle verb. The verbs essere and avere are ALWAYS in the present tense. The verb that comes after essere and avere is ALWAYS in the past participle. The present perfect is used to express actions that happened in the RECENT past but the action or fact that happened in the recent past still has ties to the present. The action has been "completed". For example "last morning, I did not go to class"-> "ieri mattina, non sono andato a lezione".