I wouldn't do it. Sand from the beach itself has no benefical bacteria living on it as it's high and dry, plus you run the risk of getting sand that has been contaminated with cigarettes, sun screen, oil from boats, gasoline, pesticides, etc....and if you collect the sand from under the water, you run the risk of adding unwanted pests to your tank.
Having said that, if you insist on doing this you need to make sure that you are allowed by law to do this first! Some areas are off limits in collecting sand and many states have limits on how much you can take, so check with your local laws to make sure about this!
You also need to make sure that where you collect is not near any rivers, marinas, beaches with heavy human traffic, or open sewer pipes. Take some of the sand and put it in a bucket with enough tap water to cover it and leave this for a day. If you notice any oily residue you cannot use this sand.
I live in Florida, right near the beaches but I won't use any of the sand because all the beaches have so much human traffic I would be afraid of what I'd be adding to my tank!