Cuerno literally means "horn," like on an animal. However, it's also a key part of a hugely popular Spanish idiom: "poner los cuernos," which means "to cheat on someone."
In this song, Bad Bunny makes a clever play on words. He sings that his ex wanted a fantasy love with "unicornios" (unicorns), but instead, "sólo te dieron el cuerno" (they only gave you the horn), a witty line implying she was cheated on. This powerful twist is what makes the word so memorable in the song.
Bad Bunny has had enough in this song! He's talking to someone who only comes to him when their other relationship fails. He's tired of being the backup plan, singing, "Ya me cansé / De sólo ser por si acaso" (I'm tired / of only being your just-in-case). So, he's finally walking away. He tells her straight up, "Dile adiós a tu mejor opción / Bye, me fui, me fui" (Say goodbye to your best option / Bye, I'm gone, I'm gone).
He mixes some classic heartbreak lines like "Nadie sabe lo que tiene / Hasta que lo pierde" (Nobody knows what they have / Until they lose it) with some really sharp, funny burns. My favorite is when he points out she wanted a fantasy love "como los unicornios" (like unicorns), "Pero sólo te dieron el cuerno" (But you only got the horn), which is a clever way of saying she was cheated on. He's clearly still hurt, admitting he loses sleep thinking about her, but he knows this on-again, off-again situation isn't real love. He's done being the "alterno" (the alternate) and is taking his power back.