I try to make it a habit to never punish my dog and it should be your habit too. What this means is that you do not punish a dog but rather you force the dog to comply with you and in a few very rare cases punish the behavior of the dog. Before we get into how this works, we must look at the problem of a dog's owner and what constitutes a problem. A dog can be expected to do certain things. A dog cannot be expected to comply with an owner who is not reasonable and does not spend positive time with the dog.
Many problems start with their owners, for one reason or another.
First, look and see if there is any reasonable way to eliminate the behavior without training the dog. If the dog gets into your trash, it may be easier to keep the trash inside in a locked or non-accessible place until the trash can be removed. If a dog jumps on you every time you meet him then their are several options. If a dog is tied then you can not do anything but expect this type of behavior. If in the past you have greeted the dog after jumping on you, then you have in effect, reinforced it.