Fear, anxiety, aggression, and inappropriate behaviors in dogs and cats can be modified through desensitization and counterconditioning.
Desensitization is when a pet is exposed to a low stimulus of something they are afraid of. Once they get accustomed to this low stimulus, it is slowly increased until the pet can handle the stimulus at its normal level. Counterconditioning is when something a pet has a negative reaction to is paired with something positive to inevitably make the pet create positive associations to what they initially disliked or acted inappropriately towards.