According to wiki, crate training is the process of teaching a pet to accept a crate or cage as a familiar and safe location. Advocates claim that dogs are den-dwelling animals and that a crate can become a den substitute.
An animal will never poop in the place where it stays. Hence, it is imperative that you get the pet used to the place that you have set up for it.
This again from wiki.
Crate training is often practiced with new puppies as a method of house-training. Puppies naturally do not want to dirty the place where they sleep, so they will try as much as possible to hold it while they are in their crate. Of course, young puppies can not control their bladders for long: about one hour for every month of age. Owners of young dogs will have to continue to take the puppy outside frequently.
Crate training is the process by which a domestic pet becomes accustomed to and eventually accepts a crate. This can involve making a crate an inviting place by placing small familiar toys inside, moving the pet bed into crate, leaving unwashed items of the owner’s clothing inside, rewarding pets for entering the crate and remaining inside, incorporating the crate as part of play, feeding the pet in the crate, allowing the pet to explore and use the crate until it is no longer intimidating, and eventually building to the pet sleeping in the crate overnight.
Part of proper crate or cage training requires the pet owner to observe calm and relaxed behaviour around the crate. The pet will attribute any emotional responses such as raised voices or other nervous behaviours to the foreign object in their normal environment. It is important for the owner not to create any negative associations with the cage in order for the pet to accept the crate in a calm manner.Image by Karen Shaw