Locking a dog up in a crate may seem unfair, especially if you just saved from a shelter. But in fact, crating a dog is both smart and kind. According to the Humane Society of the United States, using a crate to train a pooch takes advantage of his natural instincts. Canines consider this space a safe place where they can nest, hide and sleep.

Crate training involves teaching your dog to feel comfortable in his crate so you can leave him in there when necessary — for instance, if you think he'll gut the couch cushions or chew your lamp wires while you're away or sleeping.

Crate training 101

The trick to successful crate training is making the spot appealing to your dog. His crate should never be used as punishment or as a place to paper train him. “Animals don’t like to mess where they sleep and relax,” says Anthea Appel, an animal naturopath in New York City. “Dogs forced to pee or poop when they’re confined may develop neurotic behaviors like poop-eating.”

Being placed in a crate may be stressful for some dogs, though, so monitor your pup carefully when you begin to train him. According to the American Society for the Prevention of Cruelty to Animals (ASPCA), if you notice your dog is upset (barking, crying, panting heavily or scratching to get out), crating him may not work out. Instead, you may find setting up a baby gate to keep him in a specific room is better for you both.

Save your sanity — and your house — with these crate-training tips.

Make it cozy. “I’ll often suggest dog owners create a kind of ‘wolf cave’ feeling in the crate,” says Appel. This means placing comfortable bedding inside and draping the outside with a blanket (leaving the front opening uncovered). A warm, dark spot like this will give your dog a sense of security.

Remove the door. Before you introduce the crate to your pooch, take the door off its hinges. This way he can peek in and explore without feeling he could be locked inside. Let him come and go as he pleases.

Tempt him with treats. Place a few goodies near the opening of the crate and just inside it to encourage your pet to wander in.

Have him dine out — then in. Another way to up your dog’s comfort factor is to associate the crate with meal times. Put your pup’s food dish nearby and serve his kibble there. If he eats his chow, slide it closer to the crate, with the goal of placing the dish inside. Move it each time, inching it toward the back of the cage. Close the door when he seems happily preoccupied with his meal. Once he’s eaten, open it back up to let him out.

Start slow. Once your pet is willing to go inside his crate and eat there, try leaving him in it for short stretches of time. Start by going into another room for a few minutes, working up to half an hour. Next, go on a quick errand — first for one hour, and then for two hours or more. An adult dog can stay in a crate for up to six hours. A puppy will be fine for three to four hours, according to the ASPCA. To keep your dog occupied in his crate, stock it with a variety of toys that he can safely chew.

Be an overnight success. Left unsupervised and unconfined during the night, some dogs really go to town chewing pillows and shoes. To help your dog feel comfortable in his crate overnight, place it in your bedroom so he can see you're there. As he learns to settle down and sleep, move his crate into the hallway, and then a nearby room and so on until you're able to leave the crate where you want it to be all the time (in a kitchen corner, for example).

Don’t let your canine get stir-crazy. Make exercise and play time a priority for your pet. “A good long walk every day, plus puzzles and other toys that stimulate the mind are great for staving off boredom — and bad behavior,” notes Appel. If you give your dog one-on-one attention when he’s not confined, as well as walks and play sessions, he may be more likely to sit calmly in his crate when you head out. “Remember, a tired dog is a good dog,” says Appel.

Jennifer Kelly Geddes is a New York City-based writer and editor who specializes in parenting, health and child development. She’s also the mom of two teen girls.