He visitado Madrid este año.
English: I have visited Madrid this year.
The 'pretérito perfecto' in Spanish is a tense used to talk about actions that have happened recently or have a connection to the present.
Use the 'pretérito perfecto' to talk about actions completed in a time period that includes the present (like today, this week), or for experiences that are relevant now.
He visitado Madrid este año.
English: I have visited Madrid this year.
¿Has visto la película?
English: Have you seen the movie?
Hemos terminado el trabajo hoy.
English: We have finished the work today.
Mis amigos han llegado tarde.
English: My friends have arrived late.