This is a half formed thought so far but I’m banging it up here anyway. Can we make washing machines that detect if there’s something in your pockets?
All clothes come down to a few basic materials, so if you could eliminate those materials anything else left must be a foreign body that perhaps shouldn’t be in the washing machine and the user alerted.