I'm a degreed electronic engineer who has been involved in electricity things for 50 years. So, what I would do, may not be the best for someone with the experience, education, etc. You are responsible for your own safety. What may be relatively safe for me may be dangerous for you.
I'd get make up some sort of pass-through plug/receptacle with wires coming off of it that I'd be able to monitor the voltage at the plug. I'd plug it into the wall receptacle and which I'd plug the dishwasher into. Then I'd connect an AC voltmeter to the monitor leads. Then I'd try to run the dishwasher. Maybe run it regularly until it didn't want to start. At that moment, I'd check the voltage at the receptacle. If it was zero, then the problem is in the feed circuit. Likely ground-fault issues, or a loose connection somewhere, but not 100% sure. If there was voltage at the monitor point and the DW wouldn't run, the problem is the dishwasher. Loose connection, bad control board, bad relay, etc.
That's just me. If you don't have the adequate background/past shocks/education/confidence/voltmeter, etc., then just ignore this post. Just my opinion....