Imán means "magnet", and in this song Vanesa Martín is cursing her own pull towards the wrong things. It starts on "una tarde de domingo improvisado" (an improvised Sunday afternoon), when someone tells her the person she loved is there. The detail that hurts is small: "saberte en otra parte, escuchándote reír" (knowing you're somewhere else, hearing you laugh).
The chorus is honest to the point of being harsh on herself: "Y tú te irás, y yo seré la idiota que se tira al mar" (and you'll leave, and I'll be the idiot who throws herself into the sea). Then she names the problem, "Maldito imán de las cosas difíciles" (damn magnet for difficult things). Maldito literally means "cursed", but here it works like an exasperated "damn". Notice the future tense in te irás and seré: she already knows how this ends. The last verse closes on "Ojalá no tengas que volver un día al lugar donde te dije 'quédate'" (I hope you never have to come back one day to the place where I told you 'stay'). Ojalá is the word Spanish speakers use for "I hope" or "if only", and quédate is the command "stay".