This has been a pretty common problem for many. One of the more unusual situations that I struggled with at one time was the connection between the wire and the spade terminal on the end of the wire at the starter solenoid. It had gone bad from I'm sure from pulling the connector off by pulling the wire rather than by grasping the connector when pulling it off, and the repitition of doing so while trouble shooting the starter problem. The bad connection inside the dirty rubber/plastic connector sheath was invisible, and it was intermittent. Take it off, put it on, it would work, then stop working. All it took was a quick snip and a replacement terminal attached. A standard 1/4 female spade terminal is all it takes. Strip back the insulation, clean the undoubtly dirty wire strands inside, crimp on a new connector, solder it for security, add shrink tube, and your back in business. Momma used to get git so mad when I was little when I yanked the cord for the chainsaw out of the wall from 10 feet away. Made me use the machete to clear that bush for a week to learn me a lesson. Never did it again. After I started kindergarten she finally let me use the tractor to clear that last acre. Some lessons you never forget.