When the caterpillar of a moth species is ready to transform itself into the adult, winged moth, it spins a cocoon. This is a pod made from silk that hardens to protect the caterpillar as it makes its transition. For butterflies the process is conducted in a chrysalis or pupa. The process inside a cocoon or chrysalis is the same, and the signs that the caterpillar may have perished inside its protective shell are similar as well.
Keep an eye on the colour of the structure. Cocoons and chrysalises tend to be white, brown, green or another colour associated with the trees on which they typically hang. If a cocoon goes very dark in colour, this is often a sign that the caterpillar inside has died.
Monitor the cocoon for dryness. Cocoons need to have a certain degree of moisture to them. This ensures that the caterpillar doesn't dry out as it pupates. A very dry cocoon may indicate the animal has perished. If you touch a cocoon and it crumbles into dry flakes, chances are no moth will emerge. If a cocoon feels dry, misting with a water spray may help.
Be aware that in the later stages of transformation, a caterpillar will move within its cocoon. It moves as it sheds its old skin and forms its new corporeal form. If you touch a cocoon during this stage, the caterpillar inside should move in response. If there is no movement, the caterpillar may be dead. However, remember that some species of caterpillar will remain in the cocoon for an extended period of time before pupation, waiting for the right conditions.
Notice whether any liquid seeps from the cocoon. A dark liquid oozing from the structure typically indicates a dead caterpillar. It may have perished from disease or adverse conditions, such as excessive warmth.
See if there is any breach in the cocoon with small insects entering and exiting it. On rare occasions, pest insects may infiltrate the cocoon and eat the caterpillar.
To maximise the chances of a caterpillar surviving and becoming a moth, keep cocoons elevated above the ground, mist occasionally with a water spray, and avoid placing in direct sunlight or next to a heat source.