First, take your fresh clams most of them will be close, while others may be slightly open. Tap on them to see if they automatically close. If they respond, they are alive, if not discard them cause they are most likely dead.
Shells that are broken may mean the clam is dead or unhealthy. Discard these.
Make sure the clams are completely submerged under the water. As the clams are soaking they will naturally spit out any salt, sand and ocean particles they have absorbed, which will clean their insides. After wash the clams carefully in running water.
Heat some olive all in a large frying pan and add the chopped garlic, let it cook for a couple of minutes the add the clams and cover until they open up.
Add the the wine (if you don't want alcohol in you recipe you can replace with fish stock), let reduce for a few minutes. Add the finely chopped parsley, salt, pepper and the red chili pepper flakes to your taste and then add the cooked spaghetti and let it cook for just one minute.
Serve right away.