Here are the steps I would take to diagnose electrical problems with a car:
1. Check the spark plugs. Look for fouling, cracking, or gaps that are too wide or narrow. Replace as needed.
2. Check the ignition timing. Use a timing light to ensure it is properly set. Adjust if necessary.
3. Test the battery with a voltmeter. It should read over 12 volts. If lower, have the battery and charging system inspected.
4. Inspect wires and connectors for cracks, corrosion or loose connections. Tighten or replace as needed.
5. Check for faulty sensors that could cause ignition or fuel delivery issues, like the crankshaft position sensor