The short answer: four different products get searched with this question and they need four different answers. A protector is thin with a waterproof membrane and washes easily on cold and gentle. An encasement zips round all six sides and washes the same way. A pad is quilted with fill inside and needs a large drum and careful drying. A topper is several inches of foam and, in most cases, cannot go in a washing machine at all, whatever the internet says. Whichever you have, the rule that matters is heat: the waterproof layer is polyurethane or TPU, and high dryer heat cracks it, which is why a protector that worked for a year suddenly stops being waterproof.
Disclosure: this post contains affiliate links, and as an Amazon Associate I earn from qualifying purchases. If you buy through them I may earn a small commission at no extra cost to you. I only recommend things I would use in my own home.