A major £1.6 million project to restore part of a harbour wall and protect a town from coastal flooding is underway.