It's hoooooot out, y'all. And if you think it's unbearable out in the open air, just imagine trapping yourself inside a metal box under that blazing sun. That's deadly.
The best way to prevent hot car deaths is education and preparation. It is never okay to intentionally leave a baby alone in a car, even if the window is cracked or the AC is on- that is neglect. Baby brain is a real thing, though, and sleep deprivation can make parents forgetful. There are apps, like Kars4Kids, and backseat alarms that can help remind you not to forget baby.
But what if you see a baby in a car with no parent in sight? The very first thing you should do is call 911. From there, you have to use your best judgement. Saving the child's life is paramount. 911 will get there as soon as possible, but if the child is clearly in distress then don't wait - break the window that is furthest away from the child. Many states have Good Samaritan Laws that will prevent you from being prosecuted or responsible for the damage done to the vehicle while rescuing a child left alone in a hot car.
When it comes to pets left alone in a hot car, things get a little murkier. The first thing you should still do is call 911. The law doesn't view animals the same way they do people, though, so be aware: if you do break a window, you will probably be on the hook for the repairs.
If you rescue an animal from a car, don't leave the scene: you could be charged with theft or even a felony. Get them some water and wait for animal control to get there and asses the animal.
But if you wait for animal control to get to the scene and they end up removing the pet from the car, then the owner could be charged with animal cruelty.