There isn't a correct way as such, it is more dependent on what you want to mean.
So "pets' cemetery" is a cemetery that is of pets. Pets' is the genitive, sometimes called the possessive, and it means that in some sense the cemetery belongs to the pets, although not necessarily in the way we usually imagine ownership.
However, "pet cemetery" is a cemetery involving pets. So instead of telling us about "ownership" of the cemetery, it talks about the cemetery itself. Pet in this instance is an attributive noun (also called a noun adjunct). It works a lot like an adjective.
So you use the genitive/possessive when you want to describe some kind of possession of or close association between two (or more) things. E.g.
- "A knight's tale" (a tale about a knight)
- "All the king's men" (all the men loyal to the king)
- "Jesus' disciples" (the disciples of Jesus).
You use an attributive noun when you want to describe one thing as an attribute of another. E.g.
- "Dog house" (a house for a dog)
- "Coffee creamer" (creamer for coffee)
- "Plug socket" (a socket for a plug)