You’ll obtain Surf from Cheren in Route 6 after beating the 5th Gym Leader and driving away Team Plasma from the PWT. This HM allows you to enter and move around in deep water.
However, you were forced to skip over some areas in the game that you couldn’t access without Surf. So once you have Surf, you may wish to head back to these locations and access the areas that required it. There are a few, so it may take a little bit of work to go through each area.