You could still be robbed
First thing you need to remember is you cannot totally eliminate the risk, you can lower it to the point where it becomes acceptable to you. Second, knowing that there's still a non-negligible chance that you'll get robbed, you want to minimize your potential losses. Third, your personal attitude and demeanour are more important than where you hide your money. The best hiding spot is useless if you stick out, act recklessly or look nervous.
Pickpockets who work daily are very good at figuring out where most people hide their valuables, who appears to be wealthy and how to extract what they can't immediately find.
Also note that there's nothing you can do with a gun barrel or knife in your face, just hand it over.
Leave non-essentials at home
The first and most obvious advice, note that cash is not the only valuable and this could include cards, passports (can be forged and resold) or bags. Remember that depending on your location, the local definition of valuable can be much lower than yours.
It's easy to force someone to max out their ATM withdrawal quota, take out small amounts for the day and leave your debit and credit cards off your person. At most you lose a little cash, as opposed to emptying your account. I usually leave my entire wallet behind and just carry a few bills to get me through the day. You can get prepaid cards before leaving (which you can cancel after returning) and leave your main ones so as to minimize your losses.
Split your items
Don't keep all your money in the same place, the wallet, purse or pants' pockets are the first place they'll check. There are small pouches just for that that you can wear between layers of clothes, some people keep bills in their sock or shoe.
If you have many documents don't keep them all in the same sleeve, fold them and distribute them in different places. Make backup copies and store them in a secure and encrypted place.
Don't show it
You can't make it entirely impossible for them to find, just harder to find than on the next person. Don't keep your wallet in your back pocket, don't take out or count money in a visible place, don't take out a wad of bills only to pick one. Check your blind spots.
If you must carry a bag, you can buy one with the zipper facing your back.
I keep my passport in an inside zipped pocket, it's not impossible to steal but harder to grab and run. This may sound counterintuitive but public areas with a lot of people aren't necessarily safer.
Use a decoy
You could always carry a second fake wallet meant to fool eventual thieves.
Be aware of your surroundings
It helps to be aware of common tricks used to part you with your stuff.
Someone tells you your back is dirty and conveniently tries to help you while swiftly emptying your pockets. I had a camera stolen this way even as I was aware of what they were trying to do.
In some Latin American countries, money changers work publicly on the street. These guys have lots of cash on them and are easy and frequent targets, stay away from such places if you don't want to become collateral.
Some places post well-meaning 'Be aware of your surroundings' signs. People can be on the lookout for those who will instinctively pat their hiding spots.
In a lot of countries, ATMs are on a outside wall or in a very public place. There are also non-official ATMs for convenience. Avoid those and use indoor, bank ATMs and have someone watch your back while you do your transaction.
Here's a list of even more common scams