First, a worm gem is crafted using 3 worm hearts. Ducio can do this, and says it’s simple once you know how, but doesn’t elaborate. After the gem is created, you must cast "Create Soul Prism", which turns the worm gem into an empty soul prism.
A soul prism that captures the soul of a once-living warrior is called a living gem, which is what grants an automaton 'true life'.
Soul prisms will not be able to hold a powerful spirit for long unless they are treated appropriately. For instance, in the case of the Banes of Chaos the Avatar must treat each prism with water from the Shrines of Order to be effective (Batlin skipped this part).