Okay the title is kind of a lie, because: you don’t. Dumping and pouring are a key toddler developmental task. The best you can do is corral the mess. One way I found that seemed to work was getting some empty boxes and trays in which to dump the objects. Kind of like a water transfer activity, but with blocks or other items instead. This work helps them cognitively by witnessing the effect of gravity, develops their sense of self by seeing that their actions affect the world around them, and refines motor skills.
I think what made the tray and box dumping more attractive than floor dumping was the sound of falling into another hard surface (vs. our floor which was carpet), as well as the fact that after Q dumped into a container, it was easy to then dump from that into another, rather than having to wait until they were all picked up to go again.