It's called a prolapse.
Isolate the hen. Keep her calm.
Use hemorrhoid ointment to soothe and lubricate. Gently work the prolapse back in and hold it for several seconds. Hopefully the hen is able to close up the vent and hold the tissues in, but you may have to repeat the process several times before she can get her systems back in order. Often there is a little blood, as long as it's not a constant drip or flow don't worry about it. It's usually just damaged capillaries in the tender tissues.
Leave her in a quiet, soft, dim place on a clean towel or paper for a day or two, until she is active and vocal and the prolapse does not recur. She may be off her laying cycle for a few days but she should recover with no complications.
In the future, avoid breaking the egg. The broken shell can cause more damage, and the egg contents can contaminate the reproductive system, causing infection. With care, you can often "pop" a stuck egg out like a cork with gentle but firm pressure on both sides of the abdomen. Massaging the abdomen can also help loosen the pelvis enough to let the egg pass intact.