You’ll need to teach your dog that walking next to you with a loose lead means they get to move forward, and that pulling you means they don’t!
The second the lead starts to tighten, stop walking. Simply stand still, keep quiet and don’t move forward again until the lead is slack, then walk on. Don’t jerk the lead back or tell your dog off, just stand and wait, calmly and quietly. If your dog does not turn back to you, try walking a couple of steps in the opposite direction to get their focus back.