I do a blending of many suggestions already made.
I don't pay any ATM transaction fees, so I try to keep enough cash on hand to get me through a day's expenses and then top up as necessary. Still remember the day in Italy when the intl link was down and no ATM would give me money.
If I under estimated what I'd need by a fair amount I use most of it to pay off my hotel bill and/or pay cash for the last couple things like meals that I'd ordinarily put on the CC.
With the bulk spent down and its a currency I use with some frequency I just keep the rest until the next trip.
If I want to get rid of any remaining small amounts I'll just buy something in Duty Free - candy, etc. I know the prices may not be "the best" but a better use than leaving the money in your sock drawer for 10 years. The other nice thing about duty free is that they're very willing to apply your cash first and then put the rest on a CC. It does seem weird to hand over every last cent you have in your pocket!
If I'm down to just pocket change I look for one of those charity bins and dump it in.
One time on a cruise we were at Bordum, our last stop in Turkey on the way to board the ship for Greece and saw some trinket in the market we liked, but didn't have enough cash. We emptied our pockets and were a few Lira short, but the shopkeeper was happy to take what we had - all part of bartering. He did express concern (with a wink) that we'd have enough to make it back to the ship - knowing it was like a 2 minute walk from where we were. All good fun.