unfortunately that's going to be a labor intensive project. You will have to follow the wires to where they go and make sure that they are all tight.
Being that the sub stays on you know you are looking for a loose wire off the other amplifier or the head unit depending on how you are powering those speakers.
if you have two amps one for the subs and one for the mains its probably not the power or ground going to them since both are not shutting down but check where the power splits to each amp.
start at the amp that isn't working unhook the cables. Test that those cables have power and proper ground then make sure they go back on cleanly (no loose strands) and tightly. proceed to follow the power wires to where they are connected.and double check everything.
If you have access to a continuity and voltage tester that will make it a bit simpler.
Depending on how clean an install it is (no panels, speaker boxes amps or seats to remove) it shouldn't take more than an hour or so. I always recommend that connections to power blocks remain easily accessible as I have had to remove amps, subs and junk like neon to get at wiring and its always a nightmare.
hope that helps