After two years of record-breaking heat that brought a surge of deaths and health emergencies, several states have enacted or are considering measures designed to protect residents—with a new focus on younger people whose vulnerability is rising with the temperatures.