To wash your hair with a broken shoulder, use the arm that is on the side without the broken shoulder and apply the shampoo to your hair.
Then lean under the shower head and use the arm that is not on the broken shoulder side or that's not in a sling to scrub your hair.
With a broken shoulder you can also wash your hair in the shower or by leaning over a sink or bath.
Do not use your operated arm to help wash your hair.
To wash under your arm, you can lean forward slightly while your arm is out of the sling as if you were doing the elbow straightening exercise.
Lean forwards slightly so that your arm hangs slightly away from the body and you should be able to wash and apply any deodorant if needed as well.
If you're still having trouble you could have someone else help you wash your hair for you if someone is around.
With a broken shoulder you'll need to move your shoulder to prevent stiffness as you heal, but don't start playing any sports, working out or lifting using your fractured shoulder before your doctor says it's safe to do so.
Physical therapy can also help your broken shoulder heal more quickly than just immobilization alone.
Even some small movements in your hands can increase blood flow throughout your arm and bring more oxygen and nutrients to the injured parts of the bone and help it to heal more quickly.