Ghosteó is the Spanish adaptation of the English slang verb 'to ghost'. It's conjugated here in the past tense, meaning 'he/she/it ghosted'.
In the song, Bad Bunny feels completely alone and sings, "Yo le pedí a Dios, pero él también me ghosteó" (I prayed to God, but he ghosted me too). This is a powerful and very modern way to express feeling ignored and abandoned, even by a higher power. Learning this word shows you how Spanish incorporates current, global slang.
Bad Bunny sets the scene perfectly: it's "Dos de la mañana en el club" (Two in the morning at the club) and everyone is having an amazing time. He's got women all over him, hookah, and drinks. He's so in the zone he's even "loco cantando 'LA CANCIÓN'" (crazily singing 'LA CANCIÓN'), which is one of his own songs! It sounds like the perfect night out, right? But then, right in the middle of the party, his mind drifts somewhere else entirely: "¿Qué estará haciendo mi ex?" (What is my ex doing?).
Suddenly, the party doesn't matter anymore. He starts spiraling, wondering if she's moved on while he's just drunk and thinking about her. He admits that even though his friends think he's happy, he's actually "muerto por dentro" (dead inside). The whole club feels empty because she's not there. He even says God "me ghosteó" (ghosted me) when he asked for help. In the end, all he can do is wonder if she's with someone new, hoping that if she ever talks about him, he'll at least be "un buen recuerdo" (a good memory).