If the machine is a direct drive, it is usually the motor coupler...here is a pretty good tutorial on inspecting it yourself:
how to inspect motor coupler for washing machine
...how old is your machine? I just went through a washing machine nightmare...that is why I had that link handy...we had an old Maytag that diligently did a load of laundry a week for 20 years before the waterpump went south...in the spirit of being "thrift", I was down on my hands and knees with a flashlight in a big puddle of soap water tryin' to figure out how to fix it...after a week of playin' handyman...I gave up...the matching Maytag dryer was getting old too, so for aesthetic purposes, I thought I would just buy a brand new set...so I blew a fortune on this new Maytag set that was Energy Star compliant, computer-controlled, and sported a fancy touchpad on it...for some odd reason, the dark clothes I wash now have white lint sticking onto it when I take it out after the spin cycle...my old 20 year old machines didn't have this problem...oh well...