When it comes to pets, toddlers are too little to understand boundaries — and your pooch may not appreciate his boundaries being crossed (or his tail being pulled). So when that inquisitive little person tries to grab a handful of food while Fido is eating, or perhaps give his ear a hard yank, a dog’s going to do what a dog knows how to do: snarl, bark and possibly nip or bite.

Helping to stop this series of unfortunate events is part of Janet Velenovsky’s job. The owner of Kaizen Pet Training and Behavior in Richmond, Virginia, and a certified dog behavior consultant, Velenovsky regularly counsels families trying to acclimate the family dog to change and the little ones who are tormenting him. She recalls one dog who got along well with older kids, but was "extremely unnerved" by the new baby in the household.

Related: Is Your Dog Stressed Out?

It's important to socialize the dog before that baby starts crawling or walking, she says.

Velenovsky’s training methods match the guidelines that the American Society for the Prevention of Cruelty to Animals (ASPCA) uses to “toddler proof” the family dog. The method involves gradually teaching your dog to tolerate potentially annoying behavior, such as little fingers poking him in the rump.

“As they explore the world, young children do a lot of grabbing, poking and pulling,” the ASPCA notes on its website. “You’ll eventually teach your child to treat your dog with gentleness and respect — but he won’t be able to grasp these concepts as a toddler. So before he starts crawling around, it’s important to help your dog get used to rough and even painful handling.”

Here’s a step by step guide to toddler-training your beloved pooch, courtesy of the ASPCA and Velenovsky.

Poke your dog gently in the side or rear , then reward him with a treat . ASPCA experts say the treat will help your pooch associate “wonderful things” with getting poked and prodded. Velenovsky agrees you need "to make a positive connection during each exercise — one that is pleasant, rather than fearful or scary." Repeat the gentle poking five times. Do this four to eight times a day, until your dog looks to you for a treat immediately afterward.

Tug your dog’s ear gently , then give him a treat. Do this several times a day until the dog clearly expects a treat after the ear tug. Do a similar exercise by pulling gently on the dog’s tail. “We want to the dog to accept any type of stimulus and be comfortable with it," says Velenovsky. "So we tug the ear gently and provide a treat, for instance, then build up tolerance from there. Gradually, you start pulling harder.”

Practice pinching your dog in different places , followed each time by a treat. Start gently and work up to harder pinching over a period of two to three weeks. As your dog grows accustomed to these mild annoyances, practice gently tugging on your pet’s fur in different spots, “with a treat as the reinforcement after each tug,” Velenovsky says.

Talk in a happy and surprised voice during each exercise . ASPCA experts suggest saying “Oh, what was that?” in a cheerful voice after each prod or poke, then giving a treat to help your dog to help him get used to the new sensations. (You can repeat “Oh, what was that?” when your toddler does the poking, thus signaling a reward is on the way.) If your dog gets nervous or pulls away, ease back on the intensity of the training until he’s comfortable again, the ASPCA recommends.

Ease your canine's urge to defend his food and toys. Even the gentlest dogs may get upset if someone comes too close to their food while eating or reaches for a favorite chew toy. Babies and toddlers don’t know that, so get your dog used to the idea that good things will happen if you approach their possessions. Start by tossing in a special treat in the dog dish while he's eating several times a day. When your dog gets used to that, the ASPCA advises, gradually move on to touching the bowl when he's chowing down and giving him a treat. After several days, when your dog is used to all this, take a few pieces of his kibble (and reward him quickly him with a treat). Eventually he’ll back away from the dish in anticipation of goodies as you or your toddler approach. Follow the same routine with dog chews and dog toys.

Related: How to Keep Your Child Safe from Dog Bites

Get Rover used to “baby moves.” Get down on all fours and crawl on the floor around your dog. You may feel silly at first, but you’ll get your pet used to the idea of people being at his level and in his space.

If you're pregnant, help your dog prepare for the new arrival. "Play recordings of baby sounds before a baby comes home," says Velenovsky. "You can let the dog experience a blanket with the baby’s smell on it. Break the experience and desensitization down into manageable steps.”

Related: Getting Your Pet Ready for the New Baby

Teach your dog to escape if necessary. If your pet appears nervous or uncomfortable around your toddler, say “Go away” in a calm and friendly voice, then point in the direction you want the dog to go, the ASPCA advises. The dog hasn’t misbehaved, so don’t speak in a harsh tone. Instead, help the dog learn that walking away is an option.

Supervise your dog and toddler closely even if the exercises seemed successful. “Number one is supervision,” Velenovsky says “Things can happen.”

Teach your child how to pet nicely. As your child learns and grows, teach him to respect your dog’s body and belongings. Demonstrate proper petting. Explain that harsh treatment is not okay. This includes riding the dog, teasing and purposefully scaring him, according to the ASPCA. And, Velenovsky says, provide your beloved pet with a “safe zone" — whether it’s in the pen or the yard — where he can enjoy some peace.

Related: Is My Dog Depressed?

Steve Evans, MA, is an award-winning journalist with more than 20 years experience in daily news, investigative, health and business journalism. Among other jobs, he has served as managing editor of the Central Virginia Newspaper Group, as a senior writer for SNL Financial and as a staff writer for The Progress Index and the Richmond Times-Dispatch.