IF A STONE IS ON THE MOUTH OF A CASK [OF WINE], (and one wishes to take out wine on Shabbat) ONE TILTS [THE CASK] ON A SIDE AND [THE STONE] FALLS OFF. IF [THE CASK] IS [STANDING] AMONG [OTHER] CASKS (and damage would be caused from the falling stone), HE LIFTS [THE CASK] OUT, TILTS IT ON A SIDE, AND [THE STONE] FALLS OFF.
Ok, that is a lot of “if’s” – although a pretty practical ruling. Wine was stored in these kinds of barrels and it would not be surprising to have a stone on top holding the lid down. But lifting the stone off would be one of the forbidden labors – even though (ironically) the entire cask can be lifted out of the group so that the stone falls without creating damage (also forbidden).
However, from this a general rule is noted:
wherever there is something permitted and something forbidden, one must occupy oneself with what is permitted, not with what is forbidden
That is, you have two things here – the forbidden stone and the permitted wine cask. The stone is incidental. The attention is on the permitted, not on the forbidden.
Actually, a good way to look at things. Looking at the array of task forbidden on Shabbat can be daunting, and perhaps discouraging. The proper attitude is to pay attention to what is permitted. And enjoy it.
Not a bad way to live life, actually.