There are a number of related idioms, but these depend on context. The most straightforward way to explain is with a more-or-less direct translation:
Nothing gets you nothing.
This would make sense in a situation where you are expected to contribute something to achieve a result, i.e. "If you put in nothing, you get nothing back".
If, on the other hand, you want to say that you can't get something where nothing exists:
You can't get blood from a stone/turnip.
Typically this idiom is used when talking about asking someone for money, i.e. "You can't get money from them because they don't have any."
Another option, to suggest you can't make something fine from coarse material:
You can't make a silk purse from a sow's ear.
This is often metaphorically applied to people, for example:
My student says he wants to be an operatic singer, but completely he's tone-deaf. I don't know what he expects me to do -- after all, you can't make a silk purse from a sow's ear.
As others have mentioned, "flogging/beating a dead horse" means you can't get effort where there is none left. This is often applied in situations where someone has already made an effort to achieve a goal, to no avail:
He keeps trying to get his book published, but I think he is flogging a dead horse.
Another idiom that implies much effort and activity has been applied to no result
chasing one's tail
like an animal who goes round in circles. This can be used in the situation where you repeatedly talk over an issue without achieving any new insight, agreement, or progress:
The negotiations went on for hours, until the moderators called for a break, saying that the two parties were simply chasing their tails, and needed to approach the discussion from a different angle.
Lastly, an idiom based on historical events, to imply a well-meaning but ultimately futile effort:
rearrange the deck chairs on the Titanic
Obviously if the ship is sinking, there is no value in arranging the chairs in a way that might be more convenient. It can be applied to any failing enterprise:
The managers spent weeks looking for ways to cut costs, but all this was just rearranging deck chairs on the Titanic as the company's sales were half what they were the previous year, and falling.