My understanding is that a garbage can is muktzah on shabbos, although the cover of the garbage can is not muktzah. If so, if it is necessary for someone to remove garbage from a garbage can on shabbos (i.e. graf shel re’i), how can one remove the garbage bag from the garbage can? The edges of the garbage bag are usually wrapped around the edges of the garbage can to hold it in place. One usually needs to grasp the edge of the garbage can in order to remove the garbage bag from the can. But in doing this, one would be touching the garbage can which is muktzah.
A garbage can will only be muktza if there was garbage inside it from before Shabbos, however if it was empty before Shabbos started (bein hashmashos) it would be a kli shemilachto l’issur, and may be moved for a permitted use. Therefore, if the can gets moved while removing the bag, it would be “l’tzorech mikomo” and not a problem. Even if there was garbage in it during bein hashmashos, the bag can still be removed, (assuming that the garbage can at this point is indeed a graf shel re’I i.e. it is overflowing and smelly), however you should be careful to only move the bag and not the can. We will not be concerned if the can ends up moving as a result of your moving the bag, because that would be “tiltul min hatzad” (indirect moving) and permitted.
As a side point, tying the garbage bag is problematic according to numerous poskim, because the knot will stay that way permanently.
Orchos Shabbos 19-341, Shalmei Yehonasan (Muktza) 3- 53.