When clams are alive they will open to breathe and then the clam will close when you touch them so you can test to see if the clam is alive or dead by touching them.
However if the clam is dead then you should not eat them because it can make you sick as they grow bacteria in them when dead quickly.
Dead clams should be thrown out and not eaten.
When cooking clams you should keep them alive until you're ready to cook them so you kill the clams right before you cook them.
But when they're already dead then they should not be eaten because it can lead to food poisoning.