how do I know if my alternator or battery needs replaced I can't tell. on 1999 Nissan Maxima

The other day I was driving everything was fine until
My brake light and battery light came on in the dash
Then as I'm sitting at the light I noticed my car was
Running rough Like almost if it wanted to cut off
On my way home the car loses power I try to accelerate
Nothing happens I coast into quik trip and try to start it
Again it won't start everything was dead so I sat and waited
With in a few minutes it started back up and then died again
It starts up when I jump start it. I need help asap..

Asked by for the 1999 Nissan Maxima
Most likely an alternator/circuit issue, have the systen tested. YOU can check for a blown fuse, if you got the owners manual to find the proper location/function of the fuses!
Measure volts at battery should be around14.0 with car runnings ..