Zig-Zagging is a simple technique where the player alternates moving side-to-side as they run forward or backward. By its nature it is vastly more difficult to accurately hit a player who zig-zags. There are several permutations of the technique as well, some utilizing a glitch to increase a player's speed.
When using the default control style Honey, press forward on the control stick to move forward while alternating between pressing either the left and right c-buttons or left and right on the d-pad.
There is also another method that utilizes a glitch which causes the player to run at about double speed when both control stick and strafing movement types are used simultaneously. Instead of moving directly forward, move the control stick left about 45°-60° while pressing the right c-button, angling yourself somewhat so your view remains relatively straight ahead. Then to zig-zag, alternate this by holding right on the control stick about 45°-60° while pressing the left c-button. If done effectively, you will be running at about 1½ to 2 times normal speed while still pointing forward.
If no enemies are around you can compound this speed boost additionally by staring down at the ground. While zig-zagging, use the c-up or d-pad up buttons to point your view downward. Looking downwards and killing enemies actually reduces the lag experiences that can appear in levels. By killing enemies, the game doesn't need to render so much at once, and looking down means that the game doesn't need to show so much at once. Both of these methods can be used to reduce lag when later on in levels. This is very valuable when speedrunning levels.
Zig-zagging is least effective when the player can still be hit. The most common strategy to counter it is to stand perfectly still and aim at the character as they run toward or away from you. This is questionable to say the least and relies heavily on quick enough reflexes to correct your aim when the player deviates left or right.
An excellent defense is to start zig-zagging in response. It will be doubly difficult to aim when both players are sporadically moving side to side, so more often then not their strategy will change.
Also, since zig-zagging covers more ground than normal movement, it is far more likely to set off Proximity Mines.