Our whole arm actually has a certain amount of weight, in a standing position, gravity can drag the arm down and create an excessive load on the shoulder.
In severe acute cases, such as traumatic sports injuries, you can wear a sling.
In a less painful case, simply put your hand in your pocket to support the arm weight.
When holding grocery bags or heavy objects, using bigger core muscles would be a lot more energy and movement efficient, therefore keep the elbow bent and close to the body.
Another example would be when opening a heavy door, hand on the handle, elbow tucked to the body, use your leg to advance forward, and use the whole body to push the door open instead of solely pushing from your arm.