Kids and dogs encounter each other daily. Sometimes they are members of the same family; sometimes they meet at the home of a friend, family member or neighbor; and sometimes they pass on the street or at a park. They don’t naturally know how to communicate with each other, though, and mistakes can have unhappy consequences.

Here are some ways to ensure that both enjoy their time together and stay safe.

Avoid too much excitement

Kids tend to run around and yell. Dogs like to run around and bark, too, but the fast movement and high-pitched tones of kids at play can get them too excited. And dogs with herding or watchdog instincts may chase and nip, especially if they think “their” child is at risk.

To make sure things don’t get out of hand, behavior consultant Debbie Martin of Veterinary Behavior Consultations in Austin, Texas, suggests the “red light, green light” game.

“If kids are running around the yard and the dog starts to chase them, we call ‘red light’ for everybody to freeze and be a tree,” she says.

That’s an opportunity to get the dog out of the situation if necessary and then give kids permission to resume play.

Teach a calm approach

Kids often want to pet dogs. Instead of automatically saying yes, have the youngsters ask the dog if it would like to be petted. Then teach the child to read the body language of the dog to indicate whether it is saying yes or no to a meet-and-greet.

A dog who welcomes petting has a relaxed body, open mouth and a tail that’s swishing with a loose wag. One who’s not so sure may signal discomfort by showing the whites of the eyes, tightening the lips, putting its ears back, leaning or looking away, putting the tail down or moving it in a slow, stiff wag. That dog would rather not be approached. Suggest the child wave to that dog instead of petting it.

Promote one-handed petting

For dogs that welcome petting, allow the dog to go to the child instead of the other way around. Children should stand still, with hands resting at their sides or gently patting their legs in encouragement. There’s no need to offer a hand or fist for the dog to sniff.

When the dog comes forward, kids can then offer a scratch under the chin or a soft pat on the shoulder. If it’s your dog, spell out how it likes to be touched.

Behavior consultant Jennifer Shryock of Family Paws in Cary, N.C., uses the phrase “One hand enough, two hands too rough.”

If children put two hands on a dog, they often end up being rougher than they intended, roughing the fur, hugging, crowding the dog or grabbing its face. One-handed petting, on the side of the dog that’s closest to the child, is gentler and prevents the child from leaning over the dog, which can seem threatening or scary to them.

Let the child pet the dog twice, then wait to see if the dog “asks” for more with a nudge or a look. If the dog has had enough, it may “shake off” or walk away.

When dogs have a choice in how they interact with kids — or anyone — they will feel more comfortable. That makes for happier and safer encounters and sets the stage for a lifelong friendship.