Search for all relationships of a node given the node id

I'm using Neo4j 5.12 and using the Neo4j browser. The data is as shown below as an example.

create (:PERSON {name:"John"})-[:MEMBER_OF]->(:CLUB {name:"BAB"})<-[:MEMBER_OF]-(:PERSON {name:"John"})

I have two nodes in relationship with one. But I want to remove the duplicate. I wish to use the id to remove the duplicate element.

match (p:PERSON)-[r]->() where elementId(p)=0 return r

The above query does not match based on id.

I think you are confusing id() and elementId(). the value zero looks like an id, not an elementId. elementIds look like the following:

4:51d44bb0-9c65-4d16-9cfa-b1bbba236953:30

Under the assumption that you don't care which node with the name:"John" property and the associated [:MEMBER_OF] relationship is removed, you can delete one of the nodes with:

MATCH (p1:PERSON {name:"John"})-[:MEMBER_OF]->(:CLUB {name:"BAB"})<-[:MEMBER_OF]-(p2:PERSON {name:"John"}) 
WHERE elementId(p1) < elementId(p2)
DETACH DELETE  p1

The DETACH DELETE is needed because there can be no dangling relationships. Note that the create statement did precisely what you told it to do.