The short answer is to make the can harder to open and less rewarding to raid. Birds are not trying to annoy you; they are following an easy food source. In open urban trash cans, the fix usually comes from a mix of container design, daily habits, and a little community pressure.
Start with the lid. If the can has no lid, ask the building manager or city sanitation department for a replacement. If replacement is not possible, use a tight-fitting lid, a weighted cover, or a simple bungee cord that keeps the lid closed but can still be opened by people. The best long-term solution is bird-proof waste bins with self-closing lids, spring flaps, or narrow openings that let people drop trash in but make it hard for birds to pull bags out. This is especially important for open urban trash cans near food shops, transit stops, and apartment entrances.
Next, reduce the reward. Put loose food waste in a tied bag before it goes into the bin, and double-bag wet or smelly waste when possible. Never leave food on top of or beside the can. If a can is overflowing, birds will treat it as a buffet, so empty it more often or add capacity. Clean up spills and crumbs around the base of the can; birds return to places where they have learned to find food. A quick rinse or sweep around the bin can make a surprising difference.
For short-term help, you can try urban bird deterrents such as reflective tape, decals, or a lightweight spinning device nearby. Move them every few days, because birds get used to stationary objects. These are supporting measures, not substitutes for a secure lid. Avoid poisons, sharp spikes on bins, and anything that could hurt children, pets, or maintenance workers.
Finally, make it a shared routine. Talk to neighbors, shop owners, and building staff about keeping trash can lids closed and reporting overflowing bins. Put up small signs asking people not to leave food beside the can and not to feed birds. If several cans on the block have the same problem, push for enclosed bins and more frequent pickups. You will not solve an urban bird problem with one trick, but consistent lids, cleaner surroundings, and fewer easy meals will steadily make your trash cans much less attractive.