The most effective way to prevent beach erosion is to replant mangrove trees, seaweeds and seagrass. The strategic planting of vegetation can be used to help control erosion. The roots of these plants help to anchor the sand and ensure that it is not carried off in erosion. This is why many areas plant seagrass and build marshes along coasts to prevent erosion.