Once you know what part you need you can then go ahead and buy it. This need not be difficult if you have a computer and Internet connection. There are many spare parts stores online; all you need is the name and model number of the part to order it and it will usually arrive on the doorstep within a few days.
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.