Diatomaceous earth is a fine powder made from crushed fossilized algae. Sounds weird, but it’s basically glass dust at a microscopic level. Slugs crawl over it, and it damages their skin, causing them to dry out.
You just sprinkle a thin line of it along baseboards or door thresholds. It’s safe for humans and pets (food-grade only!), but it’s like walking on a bed of sharp rocks for slugs.
Wear a mask when you sprinkle it, though. You don’t want to inhale the dust yourself—only slugs should get the scratchy treatment.