It took a long time for me to really learn how to treat animals. I was overly affectionate to our first dog, a small terrier, and as a result she was scared of me.
My second dog I'm ashamed to say I was abusive towards, I was the only person in our house willing and physically capable of walking him, he was so big and strong. And he yanked me around like nobody's business. I got mad.
These days dogs generally run up to me and want all the pets. I try to make up for my checkered past by loving every dog the way they want to be loved. But it took awhile.