Charging system failed

I have a 2004 Pontiac Grand Prix. When I’m driving and I go to slow down for a stop sign or what ever my car sounds like it wants to die. I have the heater going and the goes low. On the screen that’s in the car it says charging system failed. Any ideas on what this can be?

Have the battery and charging system tested and checked for corrosion at the cables. Most parts stores will do this for free.

Clean the battery connections and make sure the alternator belt is tight. Check the connections to the alternator also as TSM suggested. If those items are ok have a load test done on the charging system to check the battery and the alternator.