We got the battery and alternator checked out. And their both checking out good. But yet when we drive the car the battery light still comes on every once in a while and we then lose power to accelerate. Like it’s hard to accelerate to 40. We stop the car and pull over and shut it off. And it starts right back up just fine. Can someone please help me? I need answer.

there are only a few reasons that the battery light will come on. The alternator stops charging the battery or the engine rpm is too low for the alternator to charge the battery with the engine on and accessories being used. the alternator light works on a voltage differential. when the alternator is charging the light has good voltage on both sides of the circuit. So, no current flow. when the alternator doesn't charge enough the voltage drops on the alternator side and the voltage differential will let current to flow and start to turn on the light. The bigger the differential the brighter the light comes on.

A year, model and engine size would help looking for any specific errors.

If the system voltage gets too low it will affect all the electrical systems. Drop in voltage will affect the cars computer systems if the voltage gets below about ten and a half volts. The ignition coil could also be affected reducing the spark plug voltage to the cylinders.

because it is intermittent it may be difficult to find the problem. a bad battery connection, a bad ignition switch, a bad alternator connection, an intermittently bad alternator regulator... A shop would need to have the condition happen to them while they were checking it out to see what is happening to the charging system. If the ignition coil is shorting out it could take power away from the engine and reduce the idle so that at idle the light might come on.

if your alternator has a decoupling pulley, the pulley could be shipping. (but that would be rare. most of the time the either lock up or make noise)

no specific answer for you. it's gonna take some diagnosing to figure out what's happening on your car. Having a scanner that can graph the engine system could watch the ignition voltage while you are driving and when the condition happens see what the battery voltage is. Pulling over to where it's safe, while it is not running normal, check the alternator output, the engine rpm, check the battery connections at the battery terminals.