The coelom is a space between the gut wall and the body wall that acts as a cavity for other organs. It begins to form during the stage of embryonic development where the body cavities develop, and it allows the body's organs to move around while offering some support to the skeletal system.
In adult mammals, including humans, the coelom has right and left halves that then subdivide into further body cavities. This includes the pericardial cavity surrounding the heart, the pleural cavity surrounding the lungs and the peritoneal/abdominal cavity surrounding the other visceral organs. Although the coelom develops from the mesodermal layer, its names arise from the organs it is protecting. For example, the visceral pericardium surrounds the heart and the parietal pericardium surrounds visceral organs other than the heart and lungs.
As the body's organs develop to stay embedded in the mesoderm wall, they cannot move easily. The coelom addresses this issue by providing them with a fluid-filled space that encourages some movement. Additionally, it allows nutrients to move from the gut to the body wall with ease. This fluid also gives the body a rigid structure, which is easier for skeletal muscles to move against. Finally, it makes it easier for nutrients and waste to move around the body.