You can make the most impact by donating your time or money to organizations/charities that help the homeless and under served. For years I volunteered at a food bank and it was very rewarding.
Giving money to street beggars is a bad idea, this is particularly true if you are in an urban center where there are lots of organizations and food kitchens around that exist directly to help those people. They have easy access to food and basic essentials like toiletries, clothing and such.
Virtually all of the street folk know about these programs because homeless people talk to one-another, not to mention homeless outreach teams, social workers, government workers etc. that they interact with. When they go to sign up for General Assistance (which almost all of them are on, or some other form of assistance) they are given a wealth of information about all the programs they can use and benefit from. Lists of places to eat for free, places to get clothing, all that. And all of that is before you take into account the EBT cards. They can literally walk into almost any grocery store or fast food joint and buy food with the card, however sadly many of them trade the food money for real money (at a loss.)
The people who are really struggling to get out of homeless are using the system to get a leg up. They are staying in shelters, getting involved in programs that can help them get out of their situation. They aren't sitting on the street corner begging.
Most of the homeless are invisible to you. They are struggling with housing but they blend in with most people. They aren't begging on the street. Those are the chronic street people, and most have serious drug and alcohol problems which is why they aren't in shelters or public housing
I can't stand with people who say things like, "I don't care if they spend the money I give them on drugs/alcohol and the reason is X." -- you're not helping. If anything you are just enabling their situation further.
Lastly, there is a huge, huge issue with mental illness as a contributing factor to people being on the street. We as a society definitely need to be doing more. If you are in California take a look at the measures on the ballot for this upcoming election -- it's at least a start in that direction.