Why did they give stool softener pill plus milk magnesia. And how do I have bm if pelvis fracture?

Avoid constipation. Pelvic fractures can lead to slowing of peristaltic movement of colon, which controls bowel movements. Bed rest and pain medications are often the only initial treatment for pelvic fractures; these two markedly slow down normal colon movements. Do whatever necessary to get those bowels moving: drinks lots fluids, including prune juice, stool softener, fiber combined with fluid, senna, mom...
Avoid constipation. They gave you those meds to prevent constipation and so that you won't have to strain when you have a bowel movement. The pelvic fracture will make it harder to have a bm, but the action is the same. Do you have grab bars or an elevated toilet seat? These might help.