That's a great question, and a common issue in cities where unsecured bins can be a nuisance. For securing an urban trash can to a fixed pole, the best type of lock is typically a heavy-duty vinyl-coated steel cable lock or a long-shackle, hardened steel padlock used with a sturdy hasp.
The cable lock is often the top choice because it's flexible, allowing you to loop it through the trash can's handle and tightly around the pole before locking it. The vinyl coating protects the pole and bin from scratches. Look for a cable at least 6-8mm thick with a reliable integrated lock. This setup deters casual theft and dumping.
Alternatively, if your trash can has a robust handle or a pre-installed anchor point, you can use a weather-resistant padlock (like a shrouded shackle design) with a separate security hasp or chain. The key factors are weather resistance (stainless steel or brass), ease of use for daily collection, and strength to resist bolt cutters.
Ultimately, the goal isn't to make it impenetrable but to be a significant deterrent. A visible, sturdy lock is often enough to prevent opportunistic messes and keep your bin where it belongs.