You'll need to narrow your question to a time period and a geographic region if you want a specific answer. In the context I'm most familiar with (late medieval and early modern Europe) the short answer is land.
Despite what movies may show, rich people don't hold onto huge amounts of money at a time. Rich people in the past didn't hoard their wealth in chests of gold and jewels, just as rich people today don't have bank accounts with millions of dollars in them. But that isn't because the money isn't "safe" being stored like that. Wealth is invested in order to make more money for its owner. Gold locked up in a vault isn't doing anyone any good. But spend that chest of gold to buy a few thousand acres of land, and now you can use that land to make more money. Rent it out to farmers. Build a mill that people have to pay to use. Charge tolls on your roads. If you ever find yourself wishing you still had that chest of gold, you can sell the land and get it back. Real estate is still usually seen as a good investment today.
Land wasn't the only option, of course. A person might buy a ship, for example. They would hire a crew and buy cargo, then send it off to be sold for a profit elsewhere. But land was desirable because it was usually low risk (people always need to grow food, but your ship might sink) and because it carried with it social prestige (acquire enough of it and people start calling you a lord, and how cool is that?).