A piece of coral by the shore is likely dead .... You can tell if it is white & looks like bone.
Coral will increase the pH & KH of your tank, up to carbonate's equilibrium point of pH 8 or so. If your water is already at 8, then it will not do anything to the water.
If you want to use the coral, make sure that it is totally dead (dry it out). Then boil it to make sure all hitch-hiking critters are dead & scrub off all organic matter. Then test by soaking in some water for a week or so & make sure it will not change the water chemistry too much. <As I said before, this will be true only if your water starts out with pH of 7.8 or more.>