Diagnosis
That's almost always an unbalanced load causing the suspension system to work overtime, or something (like a bra wire) has gotten past the drum and is contacting the outer tub.
How to Fix It
Stop the cycle and redistribute the load. Open the door (you may need to wait for it to unlock), and pull the clothes out. Mix heavy items (like jeans) with lighter ones (like t-shirts) and put them back in loosely, not in one big clump. Make sure you're not washing a single heavy item like a rug or blanket by itself. Close the door and restart the spin.
If That Didn't Work
If the noise persists even with a perfectly balanced, normal load, check for foreign objects. Inspect the rubber bellows (door seal) around the entire circumference, feeling for any hard, sharp objects poking through. A common culprit on front-loaders is a small coin or hairpin stuck in the drain pump filter area.
Heads Up
Consistently running unbalanced loads can prematurely wear out the shock absorbers and springs. If the noise is a consistent metallic grinding, not just thumping, stop using it and check the pump filter—a loose object in there can destroy the pump impeller.