Laws of Muktzeh on Shabbos
10. It is permissible to handle earth and sand that was heaped up in the corner of a home [before Shabbos]. The fact that it was gathered into a heap indicates that it had been intentionally set aside to be used (1). If, however, it was scattered, it is considered part of the ground and may not be handled (2).
Similarly, if one cut a branch from a tree before Shabbos to use as a fan or to chase away flies (3) or some other similar purpose, it may be handled on Shabbos, since one has designated it for a specific purpose, thereby turning it into a utensil ("Kli"). One may not, however, take a portion of a broom on Shabbos [to use for this purpose], because it is muktzeh. Even if it was detached by a Gentile on Shabbos, it is forbidden to be handled.
(1) One should be careful not to make a hole when taking the dirt or sand, for that would be a violation of the prohibition against ploughing or, according to some, against building (See Mishna Berura 308:143). Dirt and sand that have not been set aside are considered inherently muktzeh ("muktzeh machamas gufo") and may not be handled for any purpose on Shabbos.
(2) This is true even if the owners intention was to use the dirt on Shabbos; since he scattered it where others will step all over it, it becomes nullified ("batel") and is considered part of the floor (Mishna Berura 308:144). See the Beur Halacha 308:38 for a discussion as to whether this applies only to dirt floors.
(3) One should be careful not to kill a fly in the process.