went for a 5 min drive. got out, got back in and car had 0 power. shook the positive wire around a bit then the power returned

how do i fix this? get new wires? new battery?