Most times dogs display unwanted behaviors because of an emotional need or distress, boredom, lack of knowledge or as a way to get what they want. Consider why your dog is behaving in the way he is by looking at the behavior ABC's. Don't look at a dog as good or bad, consider a behavior as wanted or unwanted.
A= Antecedence - what is happening right before the behavior?
B= Behavior - what is the dog actually doing?
C= Consequence - What happened after the behavior?
If behaviors are rewarded they will happen more often. If the behavior is punished, it will happen less often.
The dog is the one that gets to interpret a punishment or reward. A reward doesn't need to be treat or praise, it doesn't even need to be external. It can be a feeling that the dog had. Did it feel good for the dog to do it? Similarly a punishment has nothing to do with your intention, only what the dog interprets.
For example: Dog is barking for attention.
A=Dog is bored, owner is in the room but not paying attention to dog
B= Dog barks
C= Owner looks at dog and yells at it to be quiet or Owner plays with dog to get it to be quiet
In these situation was the dog punished or rewarded? Ask yourself, is this behavior happening more often or less often. If the answer is more often, your dog is being rewarded by the consequence. If the behavior happens less often, your dog is being punished by the consequence.
Let us know what behaviors you are struggling with and lets determine the ABC of that behavior to analyze what should be done to change or maintain it.