How to prepare cockles for cooking?
I'm familiar with the preparation of what the Portuguese call Amêijoa and Berbigão (the former being a clam, the later a cockle).

A general advice upfront: make sure that cockles in your region at this season are safe to eat as shellfish tend to accumulate potential harmful substances in their tissue.

Cleaning with seawater
I (or already the fishermen that collected the cockles) usually put them in a container with seawater which was changed every five or six hours. The more often you repeat this procedure the less sand you'll have in your meal (however, even in restaurants it is not uncommon to find a bit of sand). You don't want to keep them in there longer than a day though. Keep them out of direct sunlight. Refrigeration generally is not necessary for half a day to a day. Afterwards discard all individuals that are open (= dead) and use the remaining cockles to prepare your meal.

Cleaning with freshwater
I have never put them into freshwater, therefore here only a guess: theoretically you can simulate seawater by adding the right amount of salt. You'll miss all other elements though, including nutrition, and therefore will generate stress for the cockles which will likely impede their ability to filter water (= clean) and survive. I advice you to use seawater if you have access.

A recipe
A Portuguese recipe includes white wine, a fair amount of garlic, parsley and olive oil. Heat the olive oil in a pot, cut the garlic in half or quarters (not too small) and add them to the pot. Once they are precooked add the cockles and the white wine. Put a lid. Once the cockles are open they are ready to eat (some will not open - Discard closed cockles). Add the parsley when nearly all the cockles are open and cook for a minute more. Eat them straight out of the shell, maybe with a bit of lemon juice. Use bread to enjoy the cooked white wine mixture. Eat the garlic, it should taste delicious.