Creatively. Panhandling, handouts and generosity from family and friends, work for cash, work of in-kind. Probably petty theft as well. Communities develop among the homeless, and there's a lot of sharing that goes on.
Story from the front: a young man, one of many living under bridges in Indianapolis, was given a McDonald's gift card so he could get regular meals for awhile (if I recall correctly, it was from a family member). Did he keep it for himself? No, he got as many of the homeless together as he could and they all went and got dollar sandwiches and fries, made a party of it. He shared his bounty because he felt it wouldn't be right if others among his fellows were hungry while he had the means to get food.