Cocoon means a silky web spun around the larvae of many insects; it can also mean a form a self-protection for humans. Famously, caterpillars emerge from their cocoons as butterflies.
For some people, their house is a cocoon, a cozy retreat from which they can escape the world. They cocoon themselves away for a whole weekend, reading, drinking tea, not answering email or the phone. Another word for cocoon is "chrysalis," but only in the context of insects.