To make it easier for you, best to know the specific make and model of your machine. The model number and the serial number help locate a compatible item for your property. Prices vary according to product quality. Do not be fooled by brand names though. Being expensive does not necessarily denote quality. Choose what is tried and tested by other consumers.
The above list is not exhaustive, but it's a great starting point. Washing machine repair is by no means a simple task, but it becomes a lot more manageable for the average homeowner when you're at least somewhat familiar with the parts that you're looking at. Take a minute to look over the owner's manual that you received when you purchased your current unit; there should be a complete diagram with all of the parts labeled. If you misplaced the manual or can't locate a helpful diagram, there are countless online resources that can help you with your DIY repair by allowing you to look up your exact model specifications and helping you identify exactly which parts may be at the root of your washer's malfunction.