How does a black hole act as a vacuum cleaner?

It technically doesn't, given that a vacuum cleaner works via air pressure differences, and space is mostly a vacuum already. What it does do, is by an enormous amount of mass focused in a small point, create a very strong gravity field, to the point that even light cannot escape a certain proximity. This is known as the 'event horizon'. Basically, nothing we know of that crosses that line can escape the gravity, drawn into the singularity at the center.