Sounds like a loose wiring connection, follow your wires from battery to starter and to alternator tighten the loose connection.
(" Today the car wouldn't start. 5 mins later it started.")
Alternator going or is bad and doesn't keep the battery charged. Go to auto parts store and ask them to check battery and charging system. They usually all do it for free.