Not everyone wants to have their picture taken the moment you want to take it. You can beg and plead to have your subject sit still and smile but that's not always going to work.
When trying to photograph a dog or a child bribery always helps.
I had my lens cap in my hand. As soon as he spotted it he thought it was a treat. He looks so much happier after he saw it.
Pets and children both have short attention spans. Make taking pictures of them fun and exciting. Turn it into a game.
With a dog take a few pictures then hand over a few treats or play for a few minutes. Breaks are key.
Same with children. After a few pictures let them play or explore. I bring a stuff animal with me and we make it a game for the children. They have to follow the stuffed animal around and pose like him. Then on breaks they can play with him.