My standard answer every time this topic comes up:
Long winded post follows but it works if you follow it.
I spent three years teaching this almost every working day on the Police range where I was an instructor. Not trying to blow my own trumpet, but I know of what I speak.
It is a trigger control problem.
Line up on the target with a (fairly relaxed) two handed grip. Both thumbs towards the target.
Align the sights and take the slack out of the trigger.
Once you take the slack out of the trigger, you must use a steady pull to the rear.
Ensure you are not tightening your fingers as you pull the trigger. Remember the support hand should do 60-70% of the gripping. And it's not a tight grip!
Relax your master hand. Align the sights, take the slack out of the trigger, check sight alignment and pull the trigger with a slow, steady pull until it fires. Keep the trigger held to the rear for a second or so before resetting the trigger.
Just let the trigger out until you feel it reset and no more. Then take up the pressure for subsequent shots from the reset position. Don't take you finger off the trigger between shots.
Glocks have a fairly long trigger pull compared to many other pistols. This may be one of the reasons many (right handed) shooters find them to shoot low and left.
Think to yourself: Slow, steady pull.
Try to have only the first pad of your trigger finger on the trigger. If you have the finger too far onto the trigger, you can push the gun sideways when you want to pull the trigger straight to the rear. Bend from the first knuckle, not where the finger joins the hand.
Try some dry fire too. Dry fire the action a few times while watching the front sight. (Which is what you should be watching anyway.
When you can operate the trigger without the front sight dipping or moving left as the action fires, that's about how steadily you need to operate the trigger.
Another great dry fire technique is to have some else ballance an empty case on the muzzle of the pistol. Just beside the front sight. Make sure your trigger control is smooth enough so that the case stays there when the trigger is pulled.
Then, while holding the trigger to the rear, work the slide to reset the trigger. Have the empty case replaced on the muzzle and keep it there while you let the trigger out to the reset position and pull the trigger again. Do that half a dozen times and it will make a real difference to your shooting.
Have someone mix in a few drill rounds into your magazine. If your muzzle takes a dive when you hit a drill round, you can be sure that your trigger operation is too quick or jerky. (Ball and Dummy drill.)
Watch the front sight! That's what is waving around. If you are trying to see your holes in the target, you cant see see where your sights are aligned.
You can't focus on both at once. If a paper target is stapled to a board, it's not going anywhere. You will still see it in the distance, but focus on the front sight. That's what's moving around and throwing your shots off target.
Front sight, squeeze slowly!