Samsung washer won't finish cycles

Our Samsung wf350anw/xaa washer gets stuck during the middle of the wash cycle, usually on a spin or rinse cycle where it just keeps spinning and slowing down repeatedly until one of us notices it’s stuck and just stops it. It seems that the clothes are clean and rinsed but that it just won’t finish getting to the end of the wash cycle. On the flip side, all the water is basically spun out so the dryer doesn’t have to do much work. But the wash cycle will go on for hours spinning and slowing, spinning and slowing, until it’s stopped manually. Any suggestions would be awesome - thanks!