Raccoons have gotten into sticky situations like this before, as they are opportunistic scavengers and often live in urban areas. Though raccoons are often dissed for digging through garbage cans, there are ways to ensure that you can peacefully coexist with any neighborhood raccoons (one of which is, of course, securing your garbage can). According to the Washington Department of Fish & Wildlife, "As long as raccoons are kept out of human homes, not cornered, and not treated as pets, they are not dangerous."
You can watch the full rescue operation below:
(YouTube: Barcroft TV)