Some countries do that. Notably Finland and Sweden. When you buy a can of coke, or a glass bottle of beer, there is a small surcharge added to the price. When you return the empty container you receive your money back.
People discard cans/bottles in parks, at bus-stops, and people make a living collecting them and claiming the money back.
https://www.sitra.fi/en/cases/deposit-based-recycling-system...