Player Detection at Specific Coordinates

Hello, I’m trying to create an item that could function like the Totem of Undying. Its purpose would be that if a player is at coordinates y = -100 (I don't care about the other coordinates), they would be teleported to the respawn point (for example, when they click on a bed). This would happen as long as the player is holding the item. Is my reasoning correct that the first check would be to see if the player is at the right position? And the second check would be to see if the player is holding the item? Do you have a guide on the datapack hub wiki?
Continue to help post