Good Samaritan" laws, which most states have in one form or another, generally provide basic legal protection for those who assist a person who is injured or in danger. In essence, they protect the “Good Samaritan” from civil and/or criminal liability if unintended consequences result from their assistance.
In recent years, 15 number of states have written laws that specifically add language offering at least some protection to persons who enter a vehicle, even by breaking a window, to "rescue" a child. It should be noted that there may be additonal limitations such as requirement to call 911 first. This list below was last updated in June 2017.