The best way to correct a dog is by instead letting them know the behaviour that is acceptable and that you're happy to see them repeat.
The moment we try to correct a dog, they are not creating the association to the action that is causing the 'correction' that we think they are, which can cause frustration and confusion for them and us.
Instead, we may without meaning to be reinforcing the behaviour we're not happy with which can cause them to repeat it.
The next time you want to correct a behaviour, ask yourself how you could have prevented it first (Was your dog feeling bored, anxious, afraid, overtired, overexcited?) and do your best to wait until they instead display a behaviour you are happy with and focus on rewarding that.