To prevent shrinking you need to wash it in cold water and move it as little as possible until it's completely dry.
Any wool, merino or cashmere is made of animal hair. Hair is a long string of keratin that is covered by microscopic scales. In water (especially in warm water) the keratin bloats and the scales open up, making the surface of the hair rougher. If you move, wring and tumble a lot of wet hairs, their scales catch and lock together and you end up with felt. It also shrinks the fabric because the hairs pull each other closer together.
So the best thing for a garment of pure cashmere is to hand wash it. Put it in a sink, big bowl or tub of cold water with some detergent. Instead of moving it around, push it down with your hands repeatedly. Drain the detergent water and fill in fresh cold water. Again, press the garment down without moving it around too much. Repeat the rinsing until the water is clear. Dry the garment laying flat over a towel.
Most washing machines have a cold wash program, but they agitate too much for delicate clothes. You should only use a dedicated wool program. Those usually move the drum very slowly and very sparsely to avoid felting and shrinking.
Additional hack: Since the garment is made of hair, the best detergent is shampoo for damaged or dry hair. You can even give it a rinse with hair conditioner to make the garment softer and less scratchy.