The pretérito perfecto is formed with the present of haber (he, has, ha, hemos, han) plus a past participle: he trabajado, has comido, ha vivido. Most participles are regular (-ado / -ido). A short list is irregular: hecho, escrito, visto, dicho, puesto, vuelto, roto, abierto.
Textbooks often use the perfecto for a past action that still matters now, with ya, todavía no, alguna vez, nunca, este año or esta semana: ¿Has estado en Costa Rica? Todavía no he llamado.
In Latin American Spanish, speakers usually prefer the pretérito indefinido even for a recent past: Hoy comí, Esta semana viajé, Ya lo hice. You will still hear and read the perfecto, especially with alguna vez, nunca, ya and todavía no, so you need the forms. Do not use the perfecto with a finished time such as ayer, anoche, el año pasado or en 2019.
English speakers often mix the auxiliary (*yo ha comido) or invent a participle (*he escribido, *he hizo).