You have to consider how old your dishwasher is, and if parts are available, you can easily have it repaired or you will need to hire a repair service.
If the repair will cost about or more than the cost of buying a new one, you should probably buy a new unit. Usually the labor of a service technician is more expensive than the required part.
If you can still get your old dishwasher parts, you can try replacing them yourself. There are many HOW videos on YouTube. Again, if you don't have the right tools, you should also consider the cost of purchasing the required tools. In most cases, all you will need are regular everyday tools like wrenches, screwdrivers and pliers, and I also recommend a soldering iron from https://solderingironguide.com/reviews/x-tronic-model-3020-xts-review/
(It's wise for every homeowner to have a basic toolbox. Reasonably priced kits are available from Sears, Home Depot, Lowes, Amazon ...)