Cemetery Boys by Aiden Thomas
From Swoon Reads:
When his traditional Latinx family has problems accepting his gender, Yadriel becomes determined to prove himself a real brujo. With the help of his cousin and best friend Maritza, he performs the ritual himself, and then sets out to find the ghost of his murdered cousin and set it free.
However, the ghost he summons is actually Julian Diaz, the school’s resident bad boy, and Julian is not about to go quietly into death. He’s determined to find out what happened and tie up some loose ends before he leaves. Left with no choice, Yadriel agrees to help Julian, so that they can both get what they want. But the longer Yadriel spends with Julian, the less he wants to let him leave.